Wednesday, February 08, 2006

unix tip: ssh - get rid of yes/no message

normally when you ssh to a new unix/linux box, you'll be prompted with yes/no message like below:

$ ssh hostname1
The authenticity of host 'hostname1 (ip_address_hostname1)' can't be established.
RSA key fingerprint is be:eb:c6:2f:0e:d9:56:38:8c:f7:17:cd:96:f9:3c:f5.
Are you sure you want to continue connecting (yes/no)?

most of the time you just type yes, key in your password and you are in the box. but how about you need to create a script to ssh to a few servers to run some commands? then this option become handy:

$ ssh -o StrictHostKeyChecking=no hostname1
username@hostname1's password:

key in your password and you are in and of course you can use ssh-agent to get rid of the password prompt as well :)

No comments: