Home >Operation and Maintenance >CentOS >centos7 cannot connect to ssh

centos7 cannot connect to ssh

王林
王林Original
2020-04-02 09:57:254729browse

centos7 cannot connect to ssh

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

centos7 cannot connect to ssh

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

centos7 cannot connect to ssh

centos7 cannot connect to ssh

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.

centos7 cannot connect to ssh

#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.

centos7 cannot connect to ssh

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn