[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to get ssh to run in daemon script



On 27/11/16 23:55, Russell Gadd wrote:
> So I'm scrambling around in the dark. Currently my vague ideas as to
> what might be wrong are:
> 
> script doesn't know what nasbox is (it is defined in /etc/hosts)

You could test that by using the IP address

> ssh is being run without being associated as root
> ssh cannot find root's keys

This seems the most likely to me - if $HOME isn't set in the script's
environment, for example. You could explicitly tell ssh where to find
the required key, with the -i option - eg:

/usr/bin/ssh -i /root/.ssh/id_rsa root@nasbox poweroff

> nas doesn't recognise login as authorised user
> 
> I'm also starting to think I am stressing the UPS too much by running
> too many power off tests, so I'd like to resolve this without too much
> more experimentation.

You could do your testing by sshing to a different box (even localhost)
and/or running a different command?

eg "ssh root@localhost whoami > /root/test.out" ... and have a look at
the file afterwards

Richard


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: