Mohammedz.com

For Linux and Shell scripting.

How to Get a Non-Interactive SSH Connection

Leave a comment


You can generate keys in order to login to other machines without prompting for passwords. Still, this will be interactive for the first time as it provides a prompt where you have to type “yes” to enter the key to ~/.ssh/known_hosts’ . For example:

The authenticity of host ‘a1 (xxx.xxx.xxx.xxx)’ can’t be established.
RSA key fingerprint is f7:3f:6c:5c:…:16:c4:64:f4:2e:b6.
Are you sure you want to continue connecting (yes/no)?

In order to avoid this interactive SSH connection, you create a file named ~/.ssh/config , with permissions rw-r–r– and add a
single line :

StrictHostKeyChecking no

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s