Hi,
I have configured init to keep alive ssh tunnels specifying some ssh commands in /etc/ttys. (For details see init(8).) It worked perfectly.
Now I must use passphrase protected private keys for ssh. To be able to use the key without typing in the passphrase all the time (which is impossible for an automated ssh tunnel) I use the ssh-agent.
Now my problem is that ssh communicates with ssh-agent through a socket stored in the SSH_AUTH_SOCK environment variable that is totally unknown by the init. How could I pass this variable to init?
Specifying it in /etc/profile and /etc/csh.login does not work.
Tried to create a script setting and exporting the variable and make init to run it with init_script loader variable does not work.
The only way I could make it work was to specify something similar to
instead of only
in /etc/ttys.
This is problematic as it starts two processes instead of only one and init monitors the sh process instead of the ssh and can produce misleading error messages. Not the best...
So the question is again: how could I pass some environment variables to init?
Thanks!
I have configured init to keep alive ssh tunnels specifying some ssh commands in /etc/ttys. (For details see init(8).) It worked perfectly.
Now I must use passphrase protected private keys for ssh. To be able to use the key without typing in the passphrase all the time (which is impossible for an automated ssh tunnel) I use the ssh-agent.
Now my problem is that ssh communicates with ssh-agent through a socket stored in the SSH_AUTH_SOCK environment variable that is totally unknown by the init. How could I pass this variable to init?
Specifying it in /etc/profile and /etc/csh.login does not work.
Tried to create a script setting and exporting the variable and make init to run it with init_script loader variable does not work.
The only way I could make it work was to specify something similar to
Code:
sh -c 'SSH_AUTH_SOCK=/tmp/ssh-init/agent ssh user@host'
Code:
ssh user@host
This is problematic as it starts two processes instead of only one and init monitors the sh process instead of the ssh and can produce misleading error messages. Not the best...
So the question is again: how could I pass some environment variables to init?
Thanks!