326

SSH登录主机时,自动接受SSH密钥指纹

方式一

编辑用户ssh配置文件 ~/.ssh/config,加入如下内容

StrictHostKeyChecking no

方式二

指定参数连接

ssh -o "StrictHostKeyChecking no" localhost

方式三

使用 ssh-keycan 命令,提前将主机Host加入到 known_hosts 文件中

ssh-keyscan -H 192.168.110.100 >> ~/.ssh/known_hosts

也可以通过文件,批量加入到 known_hosts 中,例如:

remote-hosts.txt

192.168.110.100
192.168.110.101
192.168.110.102
ssh-keyscan -f ./remote-hosts.txt >> ~/.ssh/known_hosts
文章作者:DOTATONG
发布日期:2024-08-21
# ssh

评论

暂无

添加新评论