开发者

pssh and known_hosts file

开发者 https://www.devze.com 2023-01-30 05:45 出处:网络
when I use pssh, trying to access a remote machine which is开发者_如何学Python not inside the UNIX

when I use pssh, trying to access a remote machine which is开发者_如何学Python not inside the UNIX known hosts file, pssh freeze after giving the password. After having added the host using a direct ssh command, pssh works.

So is there an option to give to the pssh command in order to avoid this problem ?

Thanks for your help, Regards


Try pssh -O StrictHostKeyChecking=no. This works for me.

By default ssh uses the value of "ask", which causes it to ask the user whether to continue connecting to unknown host. By setting the value to "no", you avoid the question, but are no longer protected against certain attacks. E.g. if you are connecting to hostA, and someone puts hostB there with the same IP address, then by default ssh will notice that hostB has changed, and will prompt you about it. With StrictHostKeyChecking=no, it will silently assume everything is OK.


You need to add the remote host key to the known_hosts file first. You can do that with a shell command:

ssh-keyscan HOSTNAME >> $HOME/.ssh/known_hosts
0

精彩评论

暂无评论...
验证码 换一张
取 消