Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with ssh noninteractive login

2 views
Skip to first unread message

jarek

unread,
Nov 19, 2009, 7:00:41 AM11/19/09
to
Hi all!

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

James Taylor

unread,
Nov 28, 2009, 12:46:52 AM11/28/09
to

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

0 new messages