Jim Cheetham wrote:

G Chinnery wrote:

Here is the URL to the script. Duh me I should of put that in my first post. sorry..
I have a mix of Mandrake 8.1 and 10.0 official at the moment.


http://www.mobius-soft.com/htmlperlseti.htm


OK, to me that looks like a program that collects the setistatistics_data file from a number of local machines, collates them and makes a nice summary page.

Here's an segment from the htmlperlseti.hosts file :-

'amanda' => [
"/home/seti/setiathome",
"/home/seti/setiathome/setistats_data",
"ssh2 -l seti",
"ps -ef | grep setiathome | grep -v grep | grep -v xseti | grep -v tkseti | grep -v rsh | grep -v ssh",
"[EMAIL PROTECTED]"
],


The third element is "rshcommand" and I guess that's what you're trying to set up.

part of mine is this....

'apollo' => [
"/home/max/setiathome",
"/home/max/setiathome/setistats_data",
"ssh -l max",
"ps -ef | grep setiathome | grep -v grep | grep -v tkseti | grep -v ssh",
"[EMAIL PROTECTED]"
],





From your previous emails, I guess the seti client is installed under the username "max" on your machines, so the first two array elements would be "/home/max/setiathome" and "/home/max/setiathome/setistats_data", or something similar.

correct


Now, it sounds like you've set up ssh access so that your webserver user "apache" has a private key in "/home/apache/.ssh", and you have edited the "/home/apache/.ssh/authorized_keys" files on the other machines.

su ed to root su ed to apache to set up my id_rsa and id_rsa.pub keys and those are in /var/www/.ssh
had to copy the id_rsa.pub to /home/max/.ssh to scp it across to apollo:/home/max/.ssh/id_rsa.key then did what I had to do to the key.
ended up with authorized_keys file in /max/.ssh dir.



You will need to copy that authorized_keys file from the /home/apache/.ssh directories to /home/max/.ssh to be able to use "ssh -l max". When ssh tries to connect with the username "max", it will only look in "/home/max/.ssh" for keys.


Hope that works for you :-)

I still get asked for a password when I run the script, (should I call it a CGI? ) from a shell, and if I su to apache and run a command like...


ssh -v -l max apollo uname -a

I get a request for a password from max at apollo.


There are a few things you could do later on to improve your security. One would be to restrict the ssh connections from apache to max so that they can only work from your actual web server machine. You have to know the IP address that your webserver is talking from, and you can put that into the authorized_keys file, by putting the text 'from="ip.address" ' in front of the existing key data ... :-


from="127.0.0.1" ssh-dss AAAAB2342342....

-jim

one i got it working that was going to be my next move... *8-)


Graeme




Reply via email to