+3 votes
in Web & Google by (40.7k points)
I want to change the SSH port from 22 to a different value. I am using Debian Linux on my VPS. How can I change it?

1 Answer

+1 vote
by (157k points)
selected by
 
Best answer

If you are using Vesta Control Panel, you need to make two modifications to change the SSH port.

1. Open the file '/etc/ssh/sshd_config' in an editor. Uncomment the line having the port number and change the port number.

E.g.

port 1234

 Restart the SSH server by running the following command:

systemctl restart ssh

2. On the Vesta Control Panel, click on the Firewall and then edit the line that has '/SSH'. In the textbox for the port, enter the desired port number.


...