PVE 5.1 Cluster custom SSH port

WEBcast

New Member
Dec 3, 2017
3
0
1
48
My PVE's are running on machines with non-standard SSH port, other then 22.

How can I specify the ssh port to add a node to cluster?

pvecm add machine.ip

returns: unable to copy ssh ID: exit code 1

Thnx!
 
I don't get it, ssh is working fine, it looks like pvecm is using the default port for ssh.

Can I configure on PVE the ssh port per node?
 
I said I'm using a custom SSH port, always I have to use ssh -p XX <host>, has nothing to do with the ssh, my question is other please read it.
 
I said I'm using a custom SSH port, always I have to use ssh -p XX <host>, has nothing to do with the ssh [...]

That's the problem here, we expect that a plain ssh command works, without a specific port option.
So the way (the easiest, at least) to make this work is to tell the ssh clients of the PVE nodes to always use the different port, that can be done with ssh_config (not sshd_config, which are server settings) - as LnxBill said already,
open /etc/ssh/ssh_config in your favorite editor, add or uncomment the Port setting and tell it to use you custom port by default:
Code:
# edit /etc/ssh/ssh_config
Port 12345

Then it should work, test it simply by ssh'ing to a node without the -p XYZ option.

Note, if you now want to connect to another host using the default port 22 from those PVE ndoes you need to tell ssh so.
You could circumvent this by using /root/.ssh/config host entries for all nodes instead of the global ssh_config option change, so only for those a different port would get choosen, but this needs more to maintain.
 
  • Like
Reactions: Juan Redondo Bayo