Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
How to run SSH on a different portMike Peters, 12-21-2009 |
By default SSH runs on port 22. One of the easiest ways to make it more difficult for hackers to run dictionary attacks on your server, attempting to brute-force ssh-login, is to run ssh on a different port.
Open up /etc/ssh/sshd_config and add this line at the top:
Replace 1234 with the port number you'd like to run ssh on. If there is already a Port line in your sshd_config file, comment it with a #
Now, Restart sshd by issuing:
Test ssh works properly by connecting locally (replace 1234 with the new port number):
Open up /etc/ssh/sshd_config and add this line at the top:
Port 1234
Replace 1234 with the port number you'd like to run ssh on. If there is already a Port line in your sshd_config file, comment it with a #
Now, Restart sshd by issuing:
/etc/rc.d/init.d/sshd restart
Test ssh works properly by connecting locally (replace 1234 with the new port number):
ssh -l USERNAME localhost -p 1234
![]() |
Mike Peters, 12-31-2009 |
If you're using rsync and you switched ssh to a different port, you're going to have to pass one extra parameter to rsync:
Where 44444 is the new port number
--rsh='ssh -p44444'
Where 44444 is the new port number
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

