Bug 2884 - scp doesn't read ~/.ssh/config for second argument
Summary: scp doesn't read ~/.ssh/config for second argument
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 7.2p2
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-20 02:23 AEST by Sam Bull
Modified: 2021-04-23 14:56 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Bull 2018-07-20 02:23:37 AEST
When I run 'scp -v A B', it seems that my user config is not read for B. Looking closer at the output, it looks like the config is read to open a connection to A, and the the ssh connection to B is made from within the connection to A.

So, I'm assuming that means it is only reading the config files that are installed with the host A. But, I was initially expecting it to be run from my local machine, and therefore get the config from there.

If this is the desired default behaviour, it would be nice to have an option that reads the ssh configs on the local machine for B and then passes any configuration options through to A.
Comment 1 Darren Tucker 2018-07-20 09:14:35 AEST
In your example both A and B are host:/path ie a remote to remote copy?  If you want both connections to be made from A there's the three-way option to scp:

  -3  Copies between two remote hosts are transferred through the local
      host.  Without this option the data is copied directly between
      the two remote hosts.  Note that this option disables the
      progress meter.

although that also has different behaviour in that the bytes will pass through the originating host instead of directly from A to B.
Comment 2 Sam Bull 2018-07-21 01:24:37 AEST
Ah, didn't see that option. Suppose that's a good enough solution, as it also ensures no sensitive data from the config leaves the local machine (e.g. my problem was that I needed the ProxyCommand containing a port knocking sequence).
Comment 3 Damien Miller 2021-04-23 14:56:27 AEST
closing resolved bugs as of 8.6p1 release