ssh连接报错

ssh的时候可能会出现一些奇怪的错误 这里进行解析下:

成都创新互联是专业的石嘴山网站建设公司,石嘴山接单;提供网站建设、成都网站设计,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行石嘴山网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

1、ssh不允许root登录

在ssh连接的时候报如下的错误:

[root@SERVER ~]# ssh -p 10022 root@192.168.1.152

root@192.168.1.152's password: 

Permission denied, please try again.

root@192.168.1.152's password: 

Permission denied, please try again.

root@192.168.1.152's password: 

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

输入的密码是正确的但是不能连接。

这是因为目的主机没有允许root登录,是一种安全的策略。可以在目的主机修改配置:

vi /etc/ssh/sshd_config

将PermitRootLogin no  改为 PermitRootLogin yes

然后

/etc/init.d/sshd restart

再次登录就可以了

2、ssh不认证基于密码的认证

在ssh连接时候报错如下:

[root@SERVER ~]# ssh -p 10022 root@192.168.1.152

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

不给输入密码的机会。

因为目的主机上不允许密码的验证,也是一直安全,只允许有公钥的主机连接。修改目的主机配置:

vi /etc/ssh/sshd_config

将PasswordAuthentication no  改为PasswordAuthentication yes

/etc/init.d/sshd restart

再次登录就可以了

3、指纹信息不匹配

ssh的时候出现这种情况:

[root@home]# ssh 192.168.1.3
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
07:6c:c2:ce:82:d6:77:3c:b0:20:b0:e0:f2:2d:47:84.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:5
RSA host key for 192.168.1.3 has changed and you have requested strict checking.
Host key verification failed.

这个主要是一个指纹验证失败导致的,原因是以前连接过这台主机,但是现在信息改变了,所以导致不匹配。在本地将主机的指纹信息情况即可。

 > /root/.ssh/known_hosts

再次连接即可

分享题目:ssh连接报错
本文地址:https://www.cdcxhl.com/article34/pdeepe.html

成都网站建设公司_创新互联,为您提供网站收录建站公司外贸建站关键词优化网站排名网站导航

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

网站托管运营