How do i change the SSH Port?

How do I change my SSH port? (linux)

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"
NOTE: You may need to install nano (text editor) or use your default text editor if nano is not installed"
  • 47 Users Found This Useful
Was this answer helpful?

Related Articles

How do i disable IPV6 on Cent OS

disable ipv6 on centos then you can do this :-Log in via ssh and type this :-service ipv6tables...

4gb seg fixup,how to solve (CentOS)

Xen DomU: 4gb seg fixup, process A common error on a Xen DomU (as well as Dom0) in...

How can I add more CentOS repositories?

How can I add more CentOS repositories? It is possible to add more repositories that are...

How can I find the Cent OS version?

To check which release your are running you can type this into the console (bash / shell) via SSH...

How can i show my cpu info (linux)?

How can i show my cpu info? Log in to your server via SSH then typ;e the following command...