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

Re: A little daemon



On Thu, Oct 17, 2002 at 12:12:24PM +0200, Raffaele Sandrini wrote:
> I need to have a little daemon wich runs as root and receaves commands wich
> it executes and then 
> sends back the reult code of the commands. It should be very simple - no
> fancy stuff. 

I think perl might be overkill for this, unless you want to use it as a
project for learning perl sockets. You can do this with ssh or rsh
easily enough. rsh requires a ~/.rhosts entry, ssh requires either
entering a password or using RSA/DSA authentication.

If you give ssh a command to run, ssh will return the exit code of the
remote command (at least with my OpenSSH 3.4p1 install). With rsh you'll
have to add a "; echo $?" to the remote command and read the value from
stdout.

-- 
Michael Heironimus



Reply to: