Problem:
After installing CentOS with GNOME, I found that XShell cannot connect to Linux.
Cause:
sshd service is not started.
Solution:
1. IP addr found that the network card name is ens33
2. In /etc/sysconfig/network-scripts The ifcfg-ens33 file cannot be found in the / directory. The file is included in the picture below because it was a picture I took after the problem was solved.
You need to add an ens33 network configuration to the wired connection
3. After switching to the root user, check Whether sshd is installed on this machine. If it is not installed, you need to
yum install openssh-server
install the software.
#4. Start the SSH service. Enter the command:
service sshd restart
to restart the SSH service.
After restarting, you can enter:
netstat -antp | grep sshd
Check whether port 22 is started (optional)
5. Set the service to automatically start at boot
Enter the command:
chkconfig sshd on
Note: If chkconfig sshd off disables SSH startup.
Related tutorial recommendations: centos tutorial
The above is the detailed content of centos7 cannot connect to ssh. For more information, please follow other related articles on the PHP Chinese website!