Proxmox LXC SSH port change issue

I installed a Debian template LXC container and had issue to change the port on which SSH was listening. After changing the config and restarting the service, the port would be the right one, but after a reboot it would defaults back to 22.

I found this in the Proxmox forum and thought it deserved to be shared:

systemctl mask ssh.socket
systemctl mask sshd.socket

systemctl disable sshd
systemctl enable ssh

Now the SSH process use /etc/ssh/sshd_config file and all work after a restart for me.

Thanks to nadmin at : https://forum.proxmox.com/threads/ssh-doesnt-work-as-expected-in-lxc.54691/post-451843

{{ message }}

{{ 'Comments are closed.' | trans }}