How to change SSH port to another one?

Reference(Chinese): http://live.fect.com.tw/modules/newbb/viewtopic.php?topic_id=138&forum=4

To start change SSH port, you can follow these steps:

1. Find this file: /etc/ssh/sshd_config and open it using your favourite editor(e.g. vi)

2. Find this line: #port 22. This line is commented out by default and it is usually the first line of sshd_config file.

3. Remove the '#' of this line, and change the number 22 to another number, like 1234. This is the port number you would like to use.

4. Restart SSH: /etc/init.d/sshd restart

Completed!

Remember to config your iptables/firewall to accept new port and (preferrably) block all port 22 traffic.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services

Using wget bypass htaccess username password 401 authorization