Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have done a little googling and have not come up with a clear answer to this question. I was wondering if someone could help me out with this issue.

Is there a way to auto accept any RSA key inside a bash script with no user interference? I need this script to run without user intervention and it will stop every time it encounters a new ip, i just need it to accept all of them.

share|improve this question
1  
What command is being run in the bash script? You may want to look at twinpipe or expect. bisqwit.iki.fi/source/twinpipe.html linux.die.net/man/1/expect –  Erik Nedwidek May 11 '11 at 19:27
add comment

migrated from stackoverflow.com Dec 7 '11 at 17:43

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 10 down vote accepted

If all you need is to accept new unknown hosts, try this:

 ssh -o StrictHostKeyChecking=no

If you also need to accept changed host keys, you can trick SSH into using a blank file for storing it's local set of known host keys, then accepting new unknown ones. Note this is a Bad Idea™:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
share|improve this answer
    
Worked great, thanks. –  prolink007 May 11 '11 at 20:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.