Home > Operation and Maintenance > CentOS > How to solve the problem that ssh cannot connect to centos7

How to solve the problem that ssh cannot connect to centos7

王林
Release: 2020-05-23 15:34:41
Original
4239 people have browsed it

How to solve the problem that ssh cannot connect to centos7

Cause analysis:

Maybe the sshd service is not turned on

Solution:

1. Check the network card name is

ip addr
Copy after login

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.

How to solve the problem that ssh cannot connect to centos7

4. Start the SSH service

Enter the command to restart the SSH service.

service sshd restart
Copy after login

5. Set the service to automatically start at boot

Command:

chkconfig sshd on
Copy after login

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!

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