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 .

Revision #1
Created 2026-03-04 09:51:38 UTC by Diogo Gonçalo Lourenço
Updated 2026-03-04 09:51:38 UTC by Diogo Gonçalo Lourenço