I have configured my droplet using the following guide -https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-22-04
I then followed this guide to add a GUI - https://www.digitalocean.com/community/questions/how-to-install-graphical-interface
All the steps worked, until the step to establish a secure connection (Step 3 — Connecting to the VNC Desktop Securely).
I ran the code that was provided (changing the user parameter accordingly) -
> ssh -L 59000:localhost:5901 -C -N -l sammy your_server_ip
But I got the following error - Permission denied (publickey).
I do have SSH keys as the authentication method on root, and my non root user can login successfully. So I assume the key was copied successfully to that user.
I was required to set a password for the non root user, and I am not sure if that could be the cause of the error.
How can I fix this error and establish the SSH tunnel?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I will recommend you check this article
The initial setup does come as part of the requisites since in the VNC setup you’ll need a username. Make sure to setup ssh-keys for the username and re-try to connect.
When you go to your user’s home directory, in there do you see the .ssh/authorized_keys file? I’m not talking about /root/.ssh/authorized_keys but for your user sammy?
Additionally, make sure your permissions and ownerships are correct on the folder as well and that they are not root:root.
typically you want the permissions to be:
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now