Question

I am trying to scp some file to different computers using pem key, so I don't need my password. However, every time I am trying to connect to a new box, it will ask me "Seriously, you want to connect? you want to save the key?..." which is so annoying, is there some flag in scp like "yum -y" to answer yes to all those questions.

[user@commander tmp]$ scp -i mykey.pem target.txt ubuntu@xxx.xx.xx.xx:/commander
The authenticity of host 'xxx.xx.xx.xx (xxx.xx.xx.xx)' can't be established.
RSA key fingerprint is junk:junk:junk... many junks... goes here
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xxx.xx.xx.xx' (RSA) to the list of known hosts.

THanks!

Était-ce utile?

La solution

Yes, it has. -o BatchMode=yes is the direct candidate. Also you can vary StrictHostKeyChecking (it seems secure under described conditions) and UserKnownHostsFile. You can get more details on its manpages.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top