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
精彩评论