How to change SSH port on cPanel Linux server

Download PDF

1. Login to the server through SSH (port 22 by default)

2. Type this command vi /etc/ssh/sshd_config

3. Press “i” on the key to enable editing mode.

4. Where it says #Port 22 change to Port 123 (for example)

5. Now pres “esc” button on the keyboard and type :wq! to save the file and press enter.

6. Now restart the SSHd service by typing service sshd restart

6. Done

PLEASE NOT: IF YOU HAVE A FIREWALL, OPEN THE CUSTOM PORT FIRST BEFORE EDITING, IT MAY LOCK YOU OUT

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply