1

I have set up an environment with AWS EC2 based on ubuntu 14.04 and configure vncserver under it. After everything is done, I am able to connect the EC2 instance with VNC viewer and see the desktop. However, after a period of time idle on vncviewer, the connection is disconnected and I have error

"Too many authentication failures"

After I restart the vncserver by going through ssh to EC2, I am able to use vncviewer to connect to the instance again. Any solution for me to not having the error and connection is not disconnected?

enter image description here

Keet Sugathadasa
  • 11,595
  • 6
  • 65
  • 80
jacobcan118
  • 7,797
  • 12
  • 50
  • 95
  • have you configured security groups? or are you being attacked from the world on a wide open port? _voting to close as off topic_ – Matt Clark Oct 20 '16 at 23:29
  • hi, i add the port into configured security groups in aws EC2 configuration. and no, I do think i am being attached from the world – jacobcan118 Oct 21 '16 at 04:23

2 Answers2

0

I faced the same scenario. For me this happened because, multiple sessions of vncserver was running on my Server. Do the following steps...

Step 1: See the multiple VNC sessions running on your server.

You will see multiple process IDs running. (If not, still proceed to the next steps)

$ pgrep vnc

72063
119177

This is because you have run vncserver command multiple times on the server.

Step 2: Kill all processes from step 1

$ kill 72063
$ kill 119177

Step 3: Restart the VNC session

$ vncserver

Step 4: Verify whether it is working.

$ nc 104.197.91.140 5901
// alternatively you can use telnet
$ telnet 104.197.91.140 5901

// the response should like this
RFB 003.008
  • Simply try loading the VNC viewer session again
Keet Sugathadasa
  • 11,595
  • 6
  • 65
  • 80
-1

You might try these commands:

# echo $DISPLAY
# ps -aef | grep sesman
# netstat -natp | grep vnc

If memory serves, if you get to more than ten no-longer-established vnc sessions, some VNC clients no longer allow additional connections. In this case, you need to kill the vnc processes that no longer have the established status.

dmohr
  • 2,699
  • 1
  • 22
  • 22