0

I install Ubuntu server 20.04 on vmware workstation and tried to connect it without using password , in the file /etc/ssh/sshd_config I change

'passwordauthentification =no

did the "**

sudo systemctl ssh restart"

** ' generate the key via ssh-keygen copy the key into my notepad and save it as key.ppk when I upload the key with keygen i got this popup <

No supported authentification methods (server sent:publickey)

Because of that I had to et password again not lose server access , if anyone can guide me for this please !

1
  • The key generated on the windows machine needs its id_rsa.pub contents copied into the Ubuntu's users /home/user_name/.ssh/authorized_keys file. Then it will connect without a password from windows to the Ubuntu machine with the windows machine using the private key associated with that .pub key file.
    – user1179897
    Feb 16, 2021 at 15:37

1 Answer 1

1

The default sshd_config file has public key authentication enabled. So, once you disable password authentication by setting PasswordAuthentication to no, the SSH server will automatically use public key authentication.

If you didn't change it when generating the key pair using ssh-keygen, both the private and public key can be found in your home folder in ~/.ssh

You will need to convert the private key (the one without the .pub extension) into a .ppk file (you can't simply rename it). Follow the instructions posted on https://www.dmit.io/index.php?rp=/knowledgebase/10/How-to-convert-RSA-Private-Key-to-Putty-Private-Key-ppk.html to do so. (The page says "for use with WinSCP", but WinSCP and PuTTY share the same .ppk key format)

On the (Windows) client, you also need the PuTTY SSH agent to be running, and load the key.ppk file into the SSH agent. The SSH agent should be already installed along with PuTTY (you can find a shortcut to it in the Start menu), but in case you can't find it, open Windows Explorer and navigate to the folder where PuTTY is installed. The SSH agent executable is called pageant.exe, and once executed, you can access it from the system tray (the lower right corner of your desktop, near the clock).

4
  • I tried this method without uploading any key it give same popup like <No supported authentification methods (server sent:publickey)>
    – Jose
    Feb 16, 2021 at 15:25
  • I just updated the answer to include instructions for private key conversion into .ppk format.
    – wyphan
    Feb 16, 2021 at 15:26
  • I will follow instructions right away sir thank you !
    – Jose
    Feb 16, 2021 at 15:31
  • No problem, glad to help!
    – wyphan
    Feb 16, 2021 at 15:32

You must log in to answer this question.

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