Problem with ssh noninteractive login

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all!

    I'm trying to run application on remote machine via ssh. From shell I'm

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
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 ?


Re: Problem with ssh noninteractive login

jarek wrote:
Quoted text here. Click to load it

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

Site Timeline