Opening two ports at once in ssh
Using ssh
server to enable remote access, new to Ubuntu as of last week.
I need ports 22 and 222 open, but can only get 22 open after installing the ssh server. I know thats the default port.
Anyone know how to open both ports? I'm pretty sure I have done all I can on the router side of things. I'm running Ubuntu 16.04.
The ssh
daemon from openssh-server
can take multiple Port
directive (in /etc/ssh/sshd_config
) for assigning multiple ports to the single ssh
daemon.
You need to indicate the port numbers after each Port
directive in /etc/ssh/sshd_config
file e.g.:
Port 22
Port 222
Now restart the ssh
daemon, for Ubuntu 16.04:
sudo systemctl restart ssh.service