What to do if ssh login fails under centos

王林
Release: 2020-04-03 13:37:21
Original
3505 people have browsed it

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

2. Generate key (optional)

[root@cent ~]# sshd-keygen
Copy after login

3 , Modify the sshd_config configuration file

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

4. Restart sshd

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

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!