1. Centos7 modify SSH port number 1. modify/etc/ssh/sshd_configvi/etc/ssh/sshd_config # add this line under Port22 in this line. add this line under Port7156 //. 2. modify SEL
1. modify the SSH port number in Centos 7
1. modify/etc/ssh/sshd_config
Vi/etc/ssh/sshd_config
# Port 22 add the following line under this line
Port 7156 // add this line below
2. modify SELinux
Run the following command to view the ssh ports allowed by SElinux:
Install semanage,
Yum-y install policycoreutils-python
Semanage port-a-t ssh_port_t-p tcp 7156
Then confirm whether to add it.
Semanage port-l | grep ssh
If it is successful
Ssh_port_t tcp 7156, 22
3. restart ssh
Systemctl restart sshd (systemctl restart sshd. service)
4. open the ssh port in firewall
Firewall-cmd -- zone = public -- add-port = 7156/tcp -- permanent
Firewall-cmd -- reload
Firewall-cmd -- list-all-zones | grep 7156 // view the result
2. no ifconfig command. you can use yum search ifconfig to query the package.
Yum-y install net-tools
III. hostname storage directory
/Etc/hostname