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

How to solve the problem that ssh cannot connect to centos7

王林
王林Original
2020-05-23 15:34:414211browse

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

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

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!

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