Thursday, May 15, 2014

Linux - How to change default sshd port

There are many reasons why default port 22 for ssh is need to be changed. If you need to change default port or add other listening port:

1. open /etc/ssh/sshd_config with your favorite text editor
2. find line
Port 22

and

edit this value to your needs.

or if you want to add other listening port, simply add line with port. Example:

Port 22
Port 1000

after editing save config file and restart sshd:

$ sudo /etc/init.d/ssh restart

or

$ service sshd restart

dependant on system you use.

File /etc/ssh/sshd_config opened in editor



No comments:

Post a Comment