Home >Operation and Maintenance >CentOS >What to do if ssh login fails under centos

What to do if ssh login fails under centos

王林
王林Original
2020-04-03 13:37:213574browse

What to do if ssh login fails under centos

Solution:

1. Uninstall and reinstall

[root@cent ~]# yum -y remove openssh-server
[root@cent ~]# yum -y install openssh-server

2. Generate key (optional)

[root@cent ~]# sshd-keygen

3 , Modify the sshd_config configuration file

[root@cent ~]# vim /etc/ssh/sshd_config
# 添加以下内容至文件末尾处 :wq
PubkeyAuthentication yes

4. Restart sshd

[root@cent ~]# systemctl restart sshd.service

Recommended related tutorials: centos tutorial

The above is the detailed content of What to do if ssh login fails under centos. 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