I'm trying to run application on remote machine via ssh. From shell I'm
doing:
ssh -t user@host /path/to/app
and it works.
Next, I'm calling the same ssh command from my application using exec
and it works, but only if the application is started interactively from
console.
If application is stared from init.d script, remote server asks for
password. Looks like ssh called this way, doesn't use RSA key for
authentication. I've tried to add -i /path/to/key to ssh command, but it
doesn't help. I suspect that the problem is related to some environment
variables, but checked all referenced in man page of ssh without success.
What I'm doing wrong ?
Jarek
I don't know why the -i didn't work, and I'm not sure whether the -t
will require it to have a tty, but I was able to setup an ssh tunnel on
startup by using sudo like this:
exec sudo -u jarek ssh (...etc)
--
James Taylor