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

centos7 cannot connect to ssh

王林
Release: 2020-04-02 09:57:25
Original
4724 people have browsed it

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
Copy after login

install the software.

centos7 cannot connect to ssh

#4. Start the SSH service. Enter the command:

service sshd restart
Copy after login

to restart the SSH service.

After restarting, you can enter:

netstat -antp | grep sshd
Copy after login

Check whether port 22 is started (optional)

5. Set the service to automatically start at boot

Enter the command:

chkconfig sshd on
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template