How to change SSH port number on Ubuntu server
September 3rd, 2010
| Tags: administration, commandline, security, ssh, ubuntu
Changing the port number of SSH daemon is a quick way of reducing the number of SSH brute force attacks your server might face (check the file /var/log/auth.log
to see if there are many failed SSH login attempts).
- Just to be on the safe side, create a backup copy of the SSH daemon config file.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.vanilla - Edit the config file.
sudo vi /etc/ssh/sshd_config - Change the port number on the following line, e.g. to 2201 or some other unused port. Make sure you note down the port number.
Port 22 - Restart the SSH daemon. You might get kicked out of your existing session.
sudo /etc/init.d/ssh restart - When you login next remember to include the correct port.
ssh youruser@yourserver -p 2201
Leave a comment
| Trackback