LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Remotely restarting a service (http://www.linuxquestions.org/questions/linux-networking-3/remotely-restarting-a-service-529173/)

seefor 02-14-2007 11:53 PM

Remotely restarting a service
 
:newbie: :confused:

I have two Linux boxes running FreeRadius.
I have a script that copies the user file from sif-raddb-1 to sif-raddb-2:
Code:

scp /etc/raddb/users root@sif-raddb-2:/etc/raddb/
Now I would like restart the service on sif-raddb-2 and not sure where to start. I did how ever tried telnet(lol).
The service I need to restart is radiusd

Thanks in advance

prasanta 02-15-2007 12:38 AM

Quote:

restart the service on sif-raddb-2 and not sure where to start. I need to restart is radiusd
Just do the following,

root@sif-raddb-1:~#ssh root@sif-raddb-2 /etc/init.d/radiusd restart

But before that just remember to copy your public key to the machine if-raddb-2 so that when you do ssh through the script it will not ask or wait for the password. Check this for doing ssh with no pasword,

http://www.astro.caltech.edu/~mbonat...sword_ssh.html

--
Prasanta

seefor 02-15-2007 12:52 AM

Thanks mate,

I was just about to post what I found (almost like yours) :

scp /etc/raddb/users root@sif-raddb-2:/etc/raddb/
ssh root@sif-raddb-2 'exec service radiusd restart'

but it prompts me for a password.

How can I get around that :) hehe :scratch: :scratch:

prasanta 02-15-2007 01:52 AM

Just look at the link that I posted for ssh with no password.

--
Prasanta


All times are GMT -5. The time now is 07:03 AM.