How To Find And Change SSH Port Number?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-find-and-change-ssh-port-number/
PINTEREST
PINTEREST
INSTAGRAM

ssh  is default protocol used to manage remote systems which are mainly Linux and Network Devices. As it is working over network connection and uses TCP it has a default port number which is 22  . In this tutorial we will look how to change the default port number from client and server point of view.

List Server Port Configuration

Linux ssh server configuration is stored in /etc/ssh folder with a name sshd_config .  This configuration file provides a lot of configuration parameters. We can print current port configuration with the following command by grepping Port text.

Change Server Port Configuration
Change Server Port Configuration

Change Server Port Configuration

In order to change port configuration we just need to remove the # from begging of the configuration line with is listed in previous step. So

will change to the below where number is the port number we want.

and We need to restart the ssh service in order to affect changes.

Change Client Port Configuration

Now we have changes ssh port of the server but how can we specify different port than 22 in ssh client. We use Linux ssh client which uses port 22 as default. We will use -p option in order to specify port number we want to connect. In this example we will connect to the port number 2222

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-find-and-change-ssh-port-number/
PINTEREST
PINTEREST
INSTAGRAM
LEARN MORE  Git- Clone Operations