본문으로 바로가기
728x90
반응형



VNC 서버 접속 실패 해결 방법 

VNC conenction failed: vncserver too many security failures

too many authentication failures



구글 클라우드에 서버를 구축하고 VNC 뷰어를 사용하다보면


VNC conenction failed: vncserver too many security failures


또는


too many authentication failures


라는 메시지와 함께 접속이 안 될때가 있습니다.



이에 대한 해결 방법으로


만약 구글 클라우드에서 (https://console.cloud.google.com)


SSH 연결(부러우저 창에서 열기)으로 서버에 접속이 되는 경우와


되지 않는 경우에 따른 방법이 있습니다.




접속이 되는 경우는 



SSH 연결(부러우저 창에서 열기)을 한 후 pgrep vnc 를 입력합니다.


예를 들어 process id가 121333 과 같이 나온다면


kill 121333 을 입력합니다.


그리고  vncserver 를 입력하여 VNC server를 재시작 합니다.


[출처]



또는 간단하게 콘솔에  vncserver -kill :1  입력 후


vncserver 입력하여 VNC server를 재시작 합니다.


[출처]



이후 VNC 뷰어로 서버에 접속합니다.






접속이 되지 않는 경우는



구글 클라우드의 VM 인스턴스 창에서 접속이 되지 않는 인스턴스를 선택해서 


(VM 인스턴스를) 중지 한 후 중지가 완료되면 시작을 합니다


그 다음 SSH 연결(부러우저 창에서 열기)을 한 후


vncserver를 입력을 하여 VNC server를 재시작 합니다.


이후 구글 클라우드 페이지를 새로고침해서 외부 IP 주소가 갱신되면


그 갱신된 IP 주소를 VNC 뷰어에 입력해서 서버에 접속을 합니다.







그리고 어느 방법을 쓰든지


VNC server를 재시작한 이후 아래 내용 처럼


vncpasswd를 입력해서 어려운 비밀번호로 변경하는 것이 좋다고 하며


(비밀번호는 5 ~ 8 문자로 구성되야 하지만 8 자리수가 넘어가도 


9 번째 문자부터는 무시된다고 합니다.)


포트 번호도 일반적이지 않은 것이 좋다고 합니다.


vnc 비밀번호를 변경한 경우에는 VNC 뷰어에서도 새로운 비밀번호로


접속하면 됩니다.  




 






Q:


I try to connect to my vncserver running on CentOs from home computer, behind firewall. I have installed Win7 and Ubuntu both on this machine. I have an error:

VNC conenction failed: vncserver too many security failures

even when logging with right credentials (I reset passwd on CentOs) I get: authentication failure.

I observe that I have to wait a whole day to be able to relogin at all.

Is it something regarding that I try as root? I think important is also that I have to login to remote Centos through port 6050 - none else port works for me. Do I have to do something with other ports? I see that vncserver is listening on 5901, 5902 if another added - and I consider connection is established because from time to time (long time) the passwd prompt appears,... right?

I have created additional user1, password for him to CentOS and to VNC, also user2. I do:

service vncserver start

and two servers starts, one :1, and second on :2. When I try to connect to vncserverIP:1 I get what described above, but when I try connect to vncserverIP:2 it says that the trial was unsuccessful.

please help, what to do?

additionally: how to disable this lockout for a testing purposes?


A:


VNC uses a separate password system. It does not check passwords against /etc/passwd but rather against ~/.vnc/passwd, which contains a single primary password and optionally a secondary password that allows only viewing the screen.

To set your VNC password(s), use the vncpasswd command. VNC passwords must be between five and eight characters in length – characters beyond the eighth are silently ignored. So if you are using VNC over the Internet, pick a strong, random password, as attackers may use botnets that have numerous IP addresses to circumvent the lockout while cracking your password.

If you must use VNC over the Internet, run it on a randomly chosen port number (not 5900) to avoid detection in port scans that cover only the common ports. Preferably, tunnel your VNC connection over SSH to protect yourself against eavesdropping and man-in-the-middle attacks. If you do this, you should set vncserver to not accept connections from the Internet, disable password-only authentication on the SSH service and use public-key authentication to protect against common brute-force password cracking attempts.

Restarting vncserver should reset the lockout. The manual page does not mention any way to disable the (already inadequate?) lockout entirely.



출처

https://superuser.com/questions/438024/vnc-authentication-failure




VNC 서버 접속 실패 해결 방법으로 제시된 방법 :


VNC 뷰어를 사용할 경우 봇넷을 이용한 공격이 많이 있으므로 


가능한 강력한 임의의 비밀번호를 설정할 필요가 있다고 합니다.


그리고 가능한 포트 번호도 5900이 아닌 임의의 숫자로 하는 것이 좋다고 합니다.




강력한 비밀번호 예시 :


https://passwordsgenerator.net/


https://www.lastpass.com/ko/password-generator/


https://strongpasswordgenerator.com/


https://www.random.org/passwords/


위 링크에서 생성된 비밀번호를 참조해서 아주 복잡한 비밀번호를 만들 수 있습니다.







계속해서 같은 문제가 발생한다면 아래 링크 참고하시는 것도 좋을 것 같습니다.


직접 해보진 못했습니다.


https://solveoptimized.com/how-to-resolve-prevent-too-many-authentication-failures-with-vnc/


자신의 IP만 접속 가능하게 하는 방법 같습니다.


서버나 자신의 IP 확인은 https://www.whatismyip.com/ 에서 가능합니다.


또 다른 방법으로 


https://blog.rapid7.com/2017/10/04/how-to-secure-ssh-server-using-port-knocking-on-ubuntu-linux/


가 있습니다만 역시 직접 해보지는 못했습니다. 참고 하시면 될 것 같습니다.







이 글이 유익하셨다면










728x90
반응형