Proxmox – Install a direct ssh access to a container


How to make a direct ssh connection on a container.


From the host, connect on a container, for example container 100

[host] vzctl enter 100

The default port of ssh is 22, and is already used for the host. So it’s better to change the default port number on the container. The new port can be it can be the ssh port + vz container number (in our exemple, 100 + 22 = 10022)

Edit ssh_config

[100] # nano /etc/ssh/sshd_config

Changer the port number

Port 10022

Restart SSH daemon

[100] # /etc/init.d/ssh restart

Authorise forward on the host

[host] # iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m tcp --dport 10022 -j DNAT --to-destination


Raphaël has written 45 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>