At workstation, I am running scp to copy a file from host-a to host-b ssh-copy-id done to both host-a & host-b ssh-agent and ssh-add done correctly as I do not need to enter private key passphrase doing ssh host-a and ssh host-b
Now, when running: scp host-a:~/file host-b:~/, I am being asked for the password for host-b .
Why ssh-agent do not take care for the password to access host-b ?
I find out the problems:
A: host-b is a clone of host-a, even the ssh keys are the same
B: by default, scp host-a:/file host-b:/, copy will be direct from host-a to host-b without passing through workstation. Using scp -3 source:/file target:/ will force copy from source->workstation->target .
Before generating new keys, scp -3 works.
After generating new keys for host-b, the original scp command also works.
It did not ask for the passphrase of id_rsa .
It is asking for the password for host-b, but not host-a.
If copy a local file to host-b, then no password nor passphrase are being asked - scp ~/.file host-b:~/
What type of key is it? DSA, RSA (1024 or 2048). You might check that the key type is permitted. (I’ve been stung by this where I had to explicitly enable DSA key with PubkeyAcceptedKeyTypes +ssh-dss in the config file)