First, Centos 7 modify SSH port number
1, modify the/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. Modifying SELinux
Use the following command to view the SSH ports currently allowed by SELinux:
Install Semanage,
Yum-y Install Policycoreutils-python
Semanage port-a-t ssh_port_t-p TCP 7156
And then make sure you add it in.
Semanage Port-l | grep ssh
If successful will output
ssh_port_t TCP 7156, 22
3. Restart SSH
Systemctl Restart sshd (systemctl restart Sshd.service)
4. Firewall Open SSH port
Firewall-cmd--zone=public--add-port=7156/tcp--permanent
Firewall-cmd--reload
Firewall-cmd--list-all-zones |grep 7156//View Results
Second, no ifconfig command, use Yum Search ifconfig query Package
Yum-y Install Net-tools
Third, hostname Save the Directory
/etc/hostname
Centos 7 Novice on the road