I wish to get logfile from a remotePC via a gatewayServer to my local PC without keying passwords. The gateway server used acctA@gatewayServer. The remote PC used acctB@remotePC.
I have setup the SSH private/public keys on both gateway & remote.
From my local PC, I could SSH into remotePC directly via 2 hops without the need to key the 2 accounts' passwords, using:
ssh acctA@gatewayServer -t ssh acctB@remotePC
But when I use SCP with ProxyCommand, it ask me for the password for acctB. Why?
scp -Cp -o "ProxyCommand ssh -q acctA@gateway -W remotePC:22" acctB@remotePC:/opt/logpath/log1.tgz log01.tgz
Advance thanks & appreciation to anyone who can advice.