It must be my destiny to find all the SSH related bugs in PVE stack first-hand [1abcd]. Here's a new one!
Suppose you have done the reasonable thing and
Then you have done the next reasonable thing and set
(If you have allowed root to authenticate by password, it will lock you out of GUI "only", if relay-connecting (via other node) confusingly with
Well, as a matter of that convenience, all is great as long as the symlink from all the nodes'
Well, what can you do to prevent this? Well, the quickest (non-systematic) way is:
On every single node. Yes, it was never meant for this, but it works. Also, you should probably have own infrastructure set up, maybe even extra user. If you go the way of the extreme and create e.g. a service that copies the content regularly over, you would actually be able to connect even via GUI, except, counter-intuitively, from another node ONLY.
Hope this helps someone.
[1a] https://bugzilla.proxmox.com/show_bug.cgi?id=4252
[1b] https://bugzilla.proxmox.com/show_bug.cgi?id=4670
[1c] https://bugzilla.proxmox.com/show_bug.cgi?id=4886
[1d] https://bugzilla.proxmox.com/show_bug.cgi?id=5174
[1e] https://bugzilla.proxmox.com/show_bug.cgi?id=5060#c1
[2] https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)
Suppose you have done the reasonable thing and
ssh-copy-id
'd your keys to your nodes' root's authorized_keys
. This is actually only necessary with one node alone as the information is shared, after all "root on any node is already effectively root on every node" [1e]. Well, that's convenient.Then you have done the next reasonable thing and set
PermitRootLogin prohibit-password
in /etc/ssh/sshd_config
as you should. Now all is well until at some point, one of your nodes shows offline with everything else running on it and accessible, except for that node - SSH or GUI.(If you have allowed root to authenticate by password, it will lock you out of GUI "only", if relay-connecting (via other node) confusingly with
root@node: Permission denied (publickey,password)
- you could still SSH in directly, but suddenly are asked for a password.)Well, as a matter of that convenience, all is great as long as the symlink from all the nodes'
/root/.ssh/authorized_keys -> /etc/pve/priv/authorized_keys
can be followed. But /etc/pve
[2] is a virtual filesystem mounted at runtime only (and read-only if inquorate), more precisely mounted while pve-cluster.service
is running. Should the service fail, the symlink points to nowhere and so your authorized_keys
are non-existent.Well, what can you do to prevent this? Well, the quickest (non-systematic) way is:
Code:
cp /etc/pve/priv/authorized_keys ~/.ssh/authorized_keys2
On every single node. Yes, it was never meant for this, but it works. Also, you should probably have own infrastructure set up, maybe even extra user. If you go the way of the extreme and create e.g. a service that copies the content regularly over, you would actually be able to connect even via GUI, except, counter-intuitively, from another node ONLY.
Hope this helps someone.
[1a] https://bugzilla.proxmox.com/show_bug.cgi?id=4252
[1b] https://bugzilla.proxmox.com/show_bug.cgi?id=4670
[1c] https://bugzilla.proxmox.com/show_bug.cgi?id=4886
[1d] https://bugzilla.proxmox.com/show_bug.cgi?id=5174
[1e] https://bugzilla.proxmox.com/show_bug.cgi?id=5060#c1
[2] https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)
Last edited: