Link to home
Start Free TrialLog in
Avatar of peledc
peledc

asked on

Are you sure you want to continue connecting (yes/no)?

Hi,

On Red Hat Enterprise Linux Server release 5.4 (Tikanga),
I am trying to create a script that will automatically install software on a remote server.
I have it's root password and there are no security issues.
When I run the ssh/scp commands I get the question in the title.
I am looking for a way to automatically acknowledge this question

My code looks somthing like this:

ssh-keygen -R ${DG_NODE}
rm -rf  ~root/.ssh/id_rsa*                                            
alias scp='scp -o StrictHostKeyChecking=no -o BatchMode=yes '
ssh-keygen -q -t rsa -f aaa -N "" -f ~root/.ssh/id_rsa
scp ~root/.ssh/id_rsa.pub root@${DG_NODE}:~root/.ssh/authorized_keys

Using the -o UserKnownHostsFile=/dev/null  option did not help as well.
Thanks
Avatar of jackiechen858
jackiechen858
Flag of Canada image

Edit /etc/ssh/ssh_config:


StrictHostKeyChecking no
Avatar of Jan Bacher
If you have copied the public key over and performed a manual ssh or scp using that from/to account, then you shouldn't be asked again unless the keys change.
ASKER CERTIFIED SOLUTION
Avatar of Papertrip
Papertrip
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
known_hosts gets automatically updated with each new connection.  The author should not have to manually modify that file.
known_hosts gets automatically updated with each new connection.  The author should not have to manually modify that file.

I don't think anyone is suggesting that.