SSH / SCP without known_hosts check

When we want to connect to a remote host using different credentials and we have automatic login with public key, we have to use some tweaks adding some parameters to scp, like this:

-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null

Example:

scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@10.5.0.154:/home/user/filename.ext .
Back to top