Host key verification failed.
That usually means that your local SSH config has no idea who the host is and needs to have that host added to the list of known hosts in the RSA SSH list. The easiest way to fix it is to just SSH in manually like this:
ssh username@hostname
You will get a message like this; all addresses used here are examples only of course:
The authenticity of host 'hostname (123.456.789.0)' can't be established.
RSA key fingerprint is aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk:ll:mm:nn:00:11.
Are you sure you want to continue connecting (yes/no)?
Just type in yes
and then you will get this message followed by a password prompt:
Warning: Permanently added 'hostname,123.456.789.0' (RSA) to the list of known hosts.
And now the host hostname
is added to the list of known hosts on your RSA chain. So now when you run the scp
command all should work as expected. This is strictly a one-time action that you need to do on any host you plan on connecting to hostname
. After that, the “Host key verification failed.” error will not come up again.