How to change SSH port on CoreOS

Change SSH port

First you need to go to the settings of the /usr/lib/systemd/system/sshd.socket file and open it in a text editor

vi /usr/lib/systemd/system/sshd.socket

Next, find the ListenStream option and change the port to the new SSH port of your choice. Then you need to save the file

Restarting SSH

If you use a firewall on your server, you must first allow access to the new SSH port. To do this, restart the SSH daemon while using systemctl

systemctl restart sshd.socket

The SSH server will restart and will now listen on the new port.

Was this article helpful?

Related Articles

Leave A Comment?