Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pssh and known_hosts file

Tags:

python

ssh

when I use pssh, trying to access a remote machine which is 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

like image 733
oaimac Avatar asked Dec 14 '10 08:12

oaimac


People also ask

What is known_hosts file used for?

The purpose of the known_hosts file is for the client to authenticate the server they are connecting to. This error will occur when the public key the host has changes.To fix this we must remove the key causing the error.

Can I delete known_hosts file?

Your known_hosts file still has the key from the previous IP, so when you try to log into the new IP address, SSH will complain. Instead of clearing out the entire known_hosts file, you could simply remove that one line.

What is the format of the known_hosts file?

The known_hosts file is a list of hostnames (or often, hashes of hostnames), the type of the fingerprint, and the fingerprint itself (cryptographic information) in base64 encoding. The format details can be found in the OpenSSH man page, under the SSH_KNOWN_HOSTS FILE FORMAT section.

What is PSSH?

pssh is a program for executing ssh in parallel on a number of hosts. It provides features such as sending input to all of the processes, passing a password to ssh, saving output to files, and timing out. The PSSH_NODENUM and PSSH_HOST environment variables are sent to the remote host.


1 Answers

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.

like image 127
DS. Avatar answered Sep 30 '22 05:09

DS.