How to change ssh port on centos or ubuntu

From your shell window open file path like below with your favorite text editor :

vim /etc/ssh/sshd_config

Now change port as you want like below

port 2225

Save the file & exit.

Now restart the ssh service with this command :

systemctl restart sshd

Now you can login to your server with non default ssh port.

Thank you for reading this article.

Was this helpful?

1 / 0

Leave a Reply 0

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