Cause analysis:
Maybe the sshd service is not turned on
Solution:
1. Check the network card name is
ip addr
2. Look for the ifcfg-ens33 file in the /etc/sysconfig/network-scripts/ directory. If there is no such file, you need to add the network configuration manually.
3. Switch to the root user to view this file. Check whether sshd is installed on the machine. If it is not installed, you need to execute the yum install openssh-server command to install the software.
4. Start the SSH service
Enter the command to restart the SSH service.
service sshd restart
5. Set the service to automatically start at boot
Command:
chkconfig sshd on
Recommended tutorial: centos tutorial
The above is the detailed content of How to solve the problem that ssh cannot connect to centos7. For more information, please follow other related articles on the PHP Chinese website!