在配置ssh的passwordless如何避免被问Are you sure you want to continue connecting (yes/no/[fingerprint])?

[Wed Jul 10 18:21:56][1075454][root@stbm000029-vm5:~][0]# ssh stbm000019-vm16
The authenticity of host ‘stbm000019-vm16 (100.70.4.132)’ can’t be established.
ECDSA key fingerprint is SHA256:Rv8WM2UoeoVGOG93tq2Ecpswv23IqyLGvyZVkjh2iyg.
Are you sure you want to continue connecting (yes/no/[fingerprint])? ys
Please type ‘yes’, ‘no’ or the fingerprint: yes
Warning: Permanently added ‘stbm000019-vm16,100.70.4.132’ (ECDSA) to the list of known hosts.
Last login: Wed Jul 10 18:20:56 2024 from 100.70.4.132
[root@stbm000019-vm16 ~]# exit

修改/etc/ssh/ssh_config里面
StrictHostKeyChecking no
将StrictHostKeyChecking 的值设置为no就可以避免被问这个问题了

We are attempting to speed up the installation of oracle nodes for RAC installation. this requires that we get ssh installed and configured so that it doesn’t prompt for a password.

The problem is: On first usage, we are prompted for

RSA key fingerprint is 96:a9:23:5c:cc:d1:0a:d4:70:22:93:e9:9e:1e:74:2f.
Are you sure you want to continue connecting (yes/no)? yes
Is there a way to avoid that or are we doomed to connect at least once on every server from every server manually?

So instead of setting StrictHostKeyChecking no in your ssh_config file, set StrictHostKeyChecking accept-new.

Set StrictHostKeyChecking no in your /etc/ssh/ssh_config file, where it will be a global option used by every user on the server. Or set it in your ~/.ssh/config file, where it will be the default for only the current user. Or you can use it on the command line:

ssh -o StrictHostKeyChecking=no -l “ u s e r " " user" " user""host”
Here’s an explanation of how this works from man ssh_config (or see this more current version):

StrictHostKeyChecking

If this flag is set to “yes”, ssh will never automatically add host keys to the $HOME/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed. This provides maximum protection against trojan horse attacks, however, can be annoying when the /etc/ssh/ssh_known_hosts file is poorly maintained, or connections to new hosts are frequently made. This option forces the user to manually add all new hosts. If this flag is set to “no”, ssh will automatically add new host keys to the user known hosts files. If this flag is set to “ask”, new host keys will be added to the user known host files only after the user has confirmed that is what they really want to do, and ssh will refuse to connect to hosts whose host key has changed. The host keys of known hosts will be verified automatically in all cases. The argument must be “yes”, “no” or “ask”. The default is “ask”.

  • 24
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值