The documentation (README) for scp usage seems to be lacking something.
In my environment, if I follow option 1) to make scp work with ssh-ident:
1) Rename 'ssh-ident' to 'ssh' or create a symlink 'ssh' pointing to
ssh-ident in a directory in your PATH before /usr/bin or /bin
...
If you want to use ssh-ident with scp or sftp, you can simply create
symlinks for them as well:
$ scp otherhost:mydir/file.test .
ssh-ident found 'scp' as the next command to run.
Based on argv[0] (/home/someuser/bin/scp), it seems like this will create a
loop.
Please use BINARY_SSH, BINARY_DIR, or change the way
ssh-ident is invoked (eg, a different argv[0]) to make
it work correctly.
OK. Let's investigate the options.
BINARY_SSH has to be set to the binary (e.g. ssh or scp) to be used for the command in question, so it cannot be fixed ahead of time. One could use an alias, but then we are into documented option 2), which has its drawbacks.
BINARY_DIR, what is that? Well, it is not documented.
It turns out that setting it to the location of scp, e.g. /usr/bin, makes the symlink solution work.
Is option 1) mentioned above (using symlinks for scp, sftp) supposed to work without setting BINARY_DIR? If so, under which circumstances?
Or, is BINARY_DIR a prerequisite for using scp, sftp with symlinks, given no other solutions?
The documentation (README) for scp usage seems to be lacking something. In my environment, if I follow option 1) to make scp work with ssh-ident:
Then I get:
OK. Let's investigate the options.
BINARY_SSH has to be set to the binary (e.g. ssh or scp) to be used for the command in question, so it cannot be fixed ahead of time. One could use an alias, but then we are into documented option 2), which has its drawbacks.
BINARY_DIR, what is that? Well, it is not documented. It turns out that setting it to the location of scp, e.g. /usr/bin, makes the symlink solution work.
https://github.com/ccontavalli/ssh-ident/commit/3267764ee94a1e9988106472e82bec1a7683c27b seems to explain quite a bit of it, but I am not sure about one thing:
Is option 1) mentioned above (using symlinks for scp, sftp) supposed to work without setting BINARY_DIR? If so, under which circumstances? Or, is BINARY_DIR a prerequisite for using scp, sftp with symlinks, given no other solutions?