当前位置:首页 > linux > 正文内容

ssh自动添加hostkey到know_hosts

root6年前 (2020-09-22)linux1715

有时后端daemon或者脚本在执行ssh连接时,会遇到以下提示:

The authenticity of host 'git.sws.com (10.42.1.88)' can't be established.
ECDSA key fingerprint is 53:b9:f9:30:67:ec:34:88:e8:bc:2a:a4:6f:3e:97:95.
Are you sure you want to continue connecting (yes/no)? yes

而此时必须输入yes,连接才能建立。其实在ssh_config配置文件中可以配置此项,打开/etc/ssh/ssh_config文件:

找到:
# StrictHostKeyChecking ask
修改为
StrictHostKeyChecking no
 
这个选项会自动的把 ssh 的机器添加到 /root/.ssh/know_hosts 中。


扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://www.zhiqiu.top/?id=11

分享给朋友:

相关文章

linux 慎用 kill -9 干掉程序

 kill -9 强制结束某程序的时候,如果程序的有退出信号触发处理回收子进程的,将失效。会造成僵尸进程。...

python安装的时候出现python setup.py egg_info Check the logs for full command output

python安装的时候出现python setup.py egg_info Check the logs for full command output

解决yum install python2-develpip install --upgrade setuptools...

配置机自启脚本地址/etc/rc.local ,在关机卡死 a stop job running for /etc/rc.local Compatibility (*s / no limit)

给自己的程序添加开机自启写了个脚本添加,并把执行脚本命令添加到了卡机启动中/etc/rc.local (不是一个设置开机启动的好办法)开机的时候存在失败,因为依赖的服务可能还没启动脚本就启动了 只能在脚本最上面sleep...

git 忽略文件不起作用 .gitignore

git rm -r --cached . git add .   git commit -m "update .gitignore"  git status查看是否是"working di...

shell 替换文件配置

sed -i "s/enforcing/disabled/g" /etc/selinux/config...

linux 服务器时间校准

Linux 时间矫正sudo ntpdate -u ntp.api.bz第一使用可能提示ntpdate没安装,用以下命令安装即可ubuntu系统sudo apt install ntpdatecent...