[SOLVED] public private key not working in PVE

muekno

Member
Dec 15, 2023
210
13
18
I have quit a lot of of Debian 12 servers. In each of them I can login without password after I added my ssh key in /root/.ssh/authorized_keys
doing the same at my PVE I am still asked for password when try to login wiith ssh root@pve
Whats wrong?
 
I am still asked for password when try to login wiith ssh root@pve
Whats wrong?

ssh keys can only work with root@pam... afaik.

Edit: and for ssh in itself, not for the Web Gui.
 
Sorry, you might not understand me. I am not talking from GUI login, I m talking from ssh access, not from GUI access.
pve is in my DNS and it is found
So if I do "ssh root@pve" or "ssh@172.16.1.70" I should get root access to the PVE host without asked for password, when I had entered my public key in /root/.ssh/authorized keys. That is how normal Debian works, at my 5 Debian 12 Server and a lot more at my customers.
But my PVE asks me for the root password
Kind regards, Rainer
 
Sorry, you might not understand me.
Yeah, I took "root@pve" as Gui-Logon-Realm ;-)

First, just as a confirmation: it works for me. :cool:

Ssh looks into .ssh/ for keys to use. But it can "see" only those keys which have one of the default names like "id_ecdsa". If you named it "mypvekey" it won't work.

In that case you may tell it which key to use: ssh -i ~/.ssh/mypvekey root@pve .

To debug this you might toggle verbosity: ssh -vvv root@pve.
 
Some time in IT you must not think about why!

pve is not my real PVE name

Trying ssh -vvv root@pve it works
The trying ssh toot@pve it works to, do no ask me why.

I am too long in the business to not try and double check everything before asking the forum.
Appreciate your help.

Kind regards, Rainer
 
Try adding your key at /etc/pve/priv/authorized_keys
It should be linked, right?
Code:
~# ls -al /root/.ssh/
...
lrwxrwxrwx  1 root root   29 Jul  7  2021 authorized_keys -> /etc/pve/priv/authorized_keys