What to do if ssh cannot connect to centos7

王林
Release: 2020-05-21 09:51:24
Original
2962 people have browsed it

What to do if ssh cannot connect to centos7

First switch to the root user and execute the following command to check whether sshd is installed on this machine.

rpm -qa | grep ssh
Copy after login

If it is not installed, you need to execute the following command to install it.

yum install openssh-server
Copy after login

What to do if ssh cannot connect to centos7

#Then start the SSH service. Enter the following command to restart the ssh service.

service sshd restart
Copy after login

Command: service sshd start Start service | Command: service sshd stop Stop service

After restarting, you can enter: netstat -antp | grep sshd to check whether port 22 is started (optional)

What to do if ssh cannot connect to centos7

Finally set the service to automatically start at boot

Enter the following command

chkconfig sshd on
Copy after login

Note: If chkconfig sshd off, SSH is prohibited from starting at boot.

Recommended tutorial: centos tutorial

The above is the detailed content of What to do if 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