2

Very similar to Failed to open config file '/dev/fd/63', error: No such file or directory for wpa_supplicant except for the fact that I am running as root.

bash-4.4# autossh -v -M 0 -4 -o StrictHostKeyChecking=no -F <(echo "$VA_SOCKS_PROXY_SSH_CONFIG") -i <(echo "$VA_SOCKS_PROXY_PRIVATE_KEY") socks -D "0.0.0.0:2001" -N 

Warning: Identity file /dev/fd/62 not accessible: No such file or directory.
OpenSSH_7.9p1, OpenSSL 1.1.1a 20 Nov 2018
Can't open user config file /dev/fd/63: No such file or directory

The output is failing in two places. If I do a ssh-add <(echo "$VA_SOCKS_PROXY_PRIVATE_KEY") it works fine. Seems like the pipe is being read possibly by autossh first, then being read a second time by ssh (or vice versa) and therefore it is gone the second time.

UPDATE1: it appears running with just ssh reproduces same errors, so my hypothesis above is invalidated.

UPDATE2: This comment says:

It seems ssh simply doesn’t support that mode of operation, because it closes FDs 3 and higher very early in main()

Elijah Lynn
  • 1,045

1 Answers1

3

It appears that ssh closes all file descriptors early on in main() and as such does not support process substitution.

/*
 * Discard other fds that are hanging around. These can cause problem
 * with backgrounded ssh processes started by ControlPersist.
 */
closefrom(STDERR_FILENO + 1);

Sources

slm
  • 369,824
Elijah Lynn
  • 1,045