SSH创建known_hosts重复提示 忽略

2024-07-27 170 0

通常发生在重装系统,或IP变更但之前已经登陆过。

这个时候需要打开文件~/.ssh/known_hosts 删除此ip的指纹信息再重新登录,此警告本身是出于安全考虑,避免被中间人攻击。

那怎么配置指定关闭指纹的检查呢。

MacBookPro:~ sunday$ ssh sunday@192.168.77.12
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:Smrhy10B4sJZO9GJPaoYC1XBlsNz0MGFEfidB9nKYW4.
Please contact your system administrator.
Add correct host key in /Users/sunday/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/sunday/.ssh/known_hosts:256
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
sunday@192.168.77.12: Permission denied (publickey,password).
MacBookPro:~ sunday$ cat ~/.ssh/config

# 所有主机
Host *
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null
# 指定
Host 192.168.77.*
    StrictHostKeyChecking no
    UserKnownHostsFile=/dev/null

相关文章

nextcloud preview-generate 报错文件无权限解决
tcpdump 抓包使用小结
Linux Tcpdump抓包
Ubuntu 18 SSH禁用密码登陆失效
Ubuntu 18.04 修复重启sysctl 失效
grep 批量查询中文文件名

发布评论