加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

ssh连接问题

发布时间:2020-12-15 18:20:47 所属栏目:安全 来源:网络整理
导读:1.问题:Permission denied,please try again. 可能原因:密码错误或者对方主机不允许root用户远程登录 针对第二个原因解决方案:修改ssh服务端配置文件:vim /etc/ssh/sshd_config # Authentication: #LoginGraceTime 2m #PermitRootLogin prohibit-password Pe

1.问题:Permission denied,please try again.

可能原因:密码错误或者对方主机不允许root用户远程登录

针对第二个原因解决方案:修改ssh服务端配置文件:vim /etc/ssh/sshd_config

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes? ?添加这一句可以允许root用户远程登录
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

然后再重启ssh服务:service ssh restart

2.问题:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:BCqRWpcHuCP7H2Hu9vKVhOHWbumgivtO1WdLuFmjd9k.
Please contact your system administrator.
Add correct host key in /home/guojihai/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/guojihai/.ssh/known_hosts:2
remove with:
ssh-keygen -f "/home/guojihai/.ssh/known_hosts" -R "192.168.199.134"
ECDSA host key for 192.168.199.134 has changed and you have requested strict checking.
Host key verification failed.

可能原因分析:可能是之前登录过对方主机,但是对方改变了密码,所以需要主机的验证失败

解决方案:ssh-keygen -f "/home/guojihai/.ssh/known_hosts" -R "192.168.199.134"

然后重新登录:ssh [email?protected]

3.问题:碰见refused等问题

可能原因:可能是主机地址写错,或者是对方主机没有安装ssh服务端程序

针对第二个原因解决方案:在对方主机上执行命令:sudo apt-get install openssh-server

然后查看服务端程序是否启动:ps -e |grep ssh

如果看到sshd,证明安装启动成功,可以允许其他主机远程连接

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读