«

»

Print this Post

change the default port that OpenSSH server uses

OpenSSH by default listens to port 22 of all local addresses. To provide additional
security to the OpenSSH server, the ListenAdress and Port
directives in /etc/ssh/sshd_config file can be used.

ListenAddress – List the ip address or hosts that sshd will listen on.

Port – Specifies the port that sshd will listen to.

Example /etc/ssh/sshd_config file:

Port 40
ListenAddress 127.0.0.1
ListenAddress 172.16.45.0

Restart sshd daemon in the OpenSSH server for the changes to take effect.

# service sshd restart

Now the command below can be used to connect a client from serverip network to the OpenSSH server:

# ssh serverip -p 40

About devnumbertwo

IT consultant, software developer, technical writer, nba basketball spectator, tea (and occasionally coffee) drinker, cheese enthusiast, dog lover, and a person who once spotted heather locklear at the mall. chiggity check me out on twitter and
change the default port that OpenSSH server uses was last modified: May 26th, 2015 by devnumbertwo

Permanent link to this article: http://devnumbertwo.com/change-the-default-port-that-openssh-server-uses/