How do i change the Port SSH uses?

How do I change my SSH port?

In order to help minimize the number of port scans/brute forcing on your SSH service, its a good idea to change the SSH port to something other than 22.

You can simply :-

  • log into your VPS via SSH (shell)
  • Open your SSH configuration file using "nano /etc/ssh/sshd_config"
  • Change "#Port 22" to "Port XXXX" replacing your chosen port in there obviously. Save the file.

NOTE: Before this next step, ensure you Disable any Firewall you are using, or update it to include your new port, or you will lock yourself out of your VPS.

  • Now run "service sshd restart"
  • 69 Users Found This Useful
Was this answer helpful?

Related Articles

How To Help Protect Against DNS Reflection DDoS

More and more each day DNS servers are getting exploited and abused.  Hackers able to use...

Zombie Process Slayer - Script to kill defunct processes

Here is a small script that you can use to show you which processes are zombies and which user is...

What Program do i use to connect via SSH?

What Program do i use to connect to SSH? We recommend that you use Putty. This can be...

What Program do i use to connect via SSH?

What Program do i use to connect via SSH? We recommend that you use Putty. This can be...