How to change SSH port to another one?


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


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


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