0

I am using the TightVNC Java Viewer downloaded from here: https://www.tightvnc.com/release-jviewer-2.6.php which has built-in SSH support. Using this, I would like to connect to my Google Compute Engine instance which runs Ubuntu 16.04.

I have performed the following steps so far by referring to various online documentation:

  1. Installed TightVNC Server on the Ubuntu instance.

  2. Started the VNC Server using vncserver -localhost :1

  3. OpenSSH server is already installed on the instance.

  4. Assigned a static External IP address to the instance

  5. Tried to access the VNC Server using the TightVNC Java Viewer by specifying the SSH Host as the External IP address of the instance, SSH Port as the default 22, SSH User as the instance owner, Remote Host as localhost and the Port as the VNC port 5901.

But the connection failed with the error: Cannot establish SSH connection: No supported authentication methods available.

Note: I have tested that the VNC connection works without using SSH when I directly open the port 5901 in the Compute Engine firewall settings and run vncserver :1. This way, using the TightVNC Java Viewer itself, I can access the Mate desktop that I have installed on Ubuntu. But I would like to use a secure connection through SSH instead. So what else do I need to do to enable this?

0

2 Answers 2

1

Alternatively, if you want to use the more secure key-based authentication, you can use an ssh client to establish a tunnel independently and run vncviewer through it. A command such as this would work if you're connecting from a unix-based system:

ssh -i /path/to/key -L 5901:localhost:5901 [email protected]

Or, if you're connecting from Windows, putty provides a gui and can do tunneling as well. Then you would just point your vncviewer at localhost:5901 without ssh, and you have an encrypted vnc connection without passing the password over the wire.

0

I found out from this post that currently TightVNC supports only password authentication for SSH and not private key authentication: http://vnc-tight-list.narkive.com/IGmBV7W6/tightvnc-java-viewer-jsch-key-based-authentication . So to use it, one needs to follow the steps here to enable password authentication for SSH on the Compute Engine instance: http://itmeditate.blogspot.in/2014/03/enable-password-authentication-for.html with the caveat mentioned therein.

Additionally, make sure that you have the following configuration in your /etc/ssh/sshd_config file:

PermitRootLogin prohibit-password
PermitEmptyPasswords no
PasswordAuthentication no

and allow password authentication only for your specific username at the end of the file as mentioned here: https://serverfault.com/questions/307407/ssh-allow-password-for-one-user-rest-only-allow-public-keys

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .