How to change the port of your ssh server!

Easy Linux Stuff ...

How to avoid the majority of attempts to brute-force ssh access to your server.

1- Login using your “root” user credential.

2- Edit the file : /etc/ssh/sshd_config

Search for the lines :

# What ports, IPs and protocols we listen for
Port 22

To switch for example the ssh port to port 1468, you should replace as follow :

# What ports, IPs and protocols we listen for
Port 1468

For the choice of port, use a port greater than 1024.

3- Restart your ssh server :

# /etc/init.d/sshd restart

4- Verify that your ssh server started using the right port :

# netstat -nptl | grep 1468

(1468 is the port number defined before)

This command should return an output similar to this:

tcp       0      0 0.0.0.0:1468               0.0.0.0:*                    LISTEN     3986/sshd

If the result of the command returns nothing, Be carfull and  do not logout of the server and check…

View original post 69 more words

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s