ssh config name alias not working for scp
When you use scp with no additional options like you here, remote h1 tries to directly connect to h2.
h1 -> h2
Since h1
need to know who h2
is, h1
needs the definition of h2
. But you could also route it over your PC like
h1 -> your pc -> h2
using the option -3
scp -r -3 h1:/dir1 h2:/dir2
this will help when 'myserver' is used as alias in ssh config file
sudo scp -F ~/.ssh/config -i ~/.ssh/id_rsa some_local_file.zip myserver:some_remote_folder/