Current location - Quotes Website - Team slogan - What is the port number of SSH?
What is the port number of SSH?
Ssh default port number is 22. However, the default port number of ssh needs to be changed in practical application.

Let's briefly talk about how to change the port number of ssh under linux.

1, modify the /etc/ssh/sshd_config file.

[root @ Linux ~]# VI/etc/ssh/sshd _ config

# $OpenBSD: sshd_config,v 1.69

# This is the sshd server system-wide configuration file. see

# sshd_config(5) Learn more.

# This sshd is compiled with path =/usr/local/bin:/bin:/usr/bin.

# included in the default sshd_config policy for options.

# OpenSSH specifies options with default values, where

# Maybe, but please leave a comment. Annotated option change a

# Default value.

Port 8284 // Before this, there was a # sign, and the default was 22. It's ok to modify it.

# protocol 2, 1

# List address 0.0.0.0

#ListenAddress:

# Host key of protocol version 1

#HostKey /etc/ssh/ssh_host_key

# Host key for protocol version 2

# HostKey/etc/ssh/ssh _ host _ RSA _ key

# HostKey/etc/ssh/ssh _ host _ DSA _ key

2. Restart the ssh service, and the modified port will take effect.

[root @ Linux ~]#/etc/init . d/sshd restart

Stopping sshd: [OK]

Starting sshd: [OK]

[root@linux ~]#

3. To check whether it is correct, you can use the netstat -an command to check it.