SSH Key Refused

Andan60

New Member
Sep 9, 2024
2
0
1
I am trying to use PuTTY to access my proxmox server via a SSH key. Normally, I'm lazy and just login with the root password but I'm trying to improve security via keys. FYI, this approach is fairly new to me, got it to work with my pfSense.

Initially, I created a key via PuTTY Key Generator but no matter where I stored the public key on the server, any attempt to connect would complain about a different key.
I have tried adding my key in the following files
/etc/pve/priv/authorized_keys
/.ssh/authorized_keys
/etc/ssh/ssh_host_rsa_key.pub

I changed sshd_config
(uncommented) Hostkey /etc/ssh_host_rsa_key
(uncommented) PubkeyAuthentication yes

after any change I perform
systemctl restart ssh
systemctl restart sshd

Despite trying to use my created key, PuTTTY is always complaining that it was expecting a different key.
I even tried taking the private key and importing that into PuTTY Key Generator but I'm getting "Server refused our key"

P.S. pasting keys via Shift + Ins in the web gui shell
 
Thanks @bbgeek17
I had initially try following https://www.youtube.com/watch?v=OkY30sh-vRM but was not able to get it to work

I reviewed https://www.youtube.com/watch?v=CpBctAVCyFw which does not show what I'm trying to accomplish, I can SSH into proxmox and login with the root shell but I'm trying to use PubkeyAuthentication.

The final video was more generic but when I retried pasting the key to /.ssh/authorized_keys it WORKED!
Maybe I didn't uncomment something properly in the config when I tried inserting the key to that location.

Thanks for the help!