码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 7.6出现SSH登录失败的解决方法

时间:2019-08-29 11:58:55      阅读:769      评论:0      收藏:0      [点我收藏+]

标签:open   登录失败   ssh登录   remove   int   class   connected   lib   emc   

CentOS 7.6出现SSH登录失败的解决方案

问题重现:

iterm登录

ssh vagrant@192.168.10.10
The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.
ECDSA key fingerprint is SHA256:8nyfIaEq9jMHfb9aQIlPh5OAGXjjSVGEDiXfMjlD7H8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.
vagrant@192.168.10.10: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

sshShell登录

>   11:06:29 Connecting to 192.168.10.10 port 22
>   11:06:29 Command: ssh -p 22 vagrant@192.168.10.12
>   11:06:29 Connect to 192.168.10.12:22, with timeout 15.000000
>   11:06:29 Create socket with IPv4 address family
>   11:06:29 Socket is connected successfully
>   11:06:29 Client banner: SSH-2.0-libssh_0.7.5
>   11:06:29 Server banner: SSH-2.0-OpenSSH_7.4
>   11:06:29 Negotiated with server
>   11:06:29 Authentication that can continue: publickey, gssapi-with-mic
>   11:06:29 Disconnected from server

解决办法

1、卸载重新

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

2、生成密钥(可选)

[root@cent ~]# sshd-keygen

3、修改sshd_config配置文件

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

4、重新启动sshd

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

CentOS 7.6出现SSH登录失败的解决方法

标签:open   登录失败   ssh登录   remove   int   class   connected   lib   emc   

原文地址:https://www.cnblogs.com/zhangyangdev/p/11428341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!