Re: How to get ssh to run in daemon script

2016-11-28 Thread Russell Gadd
On 28/11/16 12:30, Richard Hector wrote: ... nas doesn't recognise login as authorised user Turns out this was the issue - problem solved.For some reason the interactive successful use of ssh must have used my non-root users key even when run by (su) root in a graphical terminal. I needed to

Re: How to get ssh to run in daemon script

2016-11-28 Thread Richard Hector
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

Re: How to get ssh to run in daemon script

2016-11-27 Thread Russell Gadd
On 27/11/16 13:00, Nemeth Gyorgy wrote: ... What user runs the daemon? If it is a separate user then run the ssh with that user interactively. If the user does not have the ~/.ssh/known_hosts file or the destination host is not in it, then you will have problems. I've now discovered that the da

Re: How to get ssh to run in daemon script

2016-11-27 Thread Nemeth Gyorgy
2016-11-27 11:55 keltezéssel, Russell Gadd írta: I am trying to add a command into a script to shut down my NAS when the UPS detects a power loss. There is a daemon apcupsd which gets a signal from the UPS and runs various scripts which can be modified by the user. I have a script doshutdown

How to get ssh to run in daemon script

2016-11-27 Thread Russell Gadd
I am trying to add a command into a script to shut down my NAS when the UPS detects a power loss. There is a daemon apcupsd which gets a signal from the UPS and runs various scripts which can be modified by the user. I have a script doshutdown as follows #!/bin/sh ... various messages and sle