Link to home
Start Free TrialLog in
Avatar of dinkon4u
dinkon4uFlag for United Arab Emirates

asked on

Starting a service remotely in Linux

Hi Freinds

My question is that, is there any way we can start | stop | restart a service running in a  remote server using scripting.

The scenario is like this.

ServerA has a  service running, ServiceA.  I want to restart ServiceA through a script, provided I have full access to ServerA. I am not telling about remotely login into ServerA and restart the ServiceA. When ever I run the script from the remote server the ServiceA must be restarted. ServerA and the RemoteSystem is always connected through internet and have a static IP address.

I tried all the options of ssh. But I am not able to find a way, that is useble for the abouve purpose. Restarting a service remotely thorugh a script.

I needed this script very urgently. It would be very helpfull for me if you find a solution for my problem

Regards
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dinkon4u

ASKER

Hi HIH

Thanks for your prompt reply, I tried your options. It worked perfectly. Now would you please tell me How much secure is the connection.  .  . :) .

Regards

NB.
I encourgae others also to post other ways to run a service remotely.  If no one appears with a better solution than this, I have to give 500 points to HIH . . . :). I will kept this open for another 48HRS.
ssh is more secure than the user!!

Basically as long as any exploits are 'patched' (i.e. the ssh binaries are up to date), and the passwords/keys are correctly secured, then the ssh approach is more secure than most other mechanisms for remote connection. For genral FAQ on ssh, have a look here:

http://www.faqs.org/faqs/computer-security/ssh-faq/

(   (()
(`-' _\
 ''  ''
Thank you HIH for helping me.

Special thanks to pjedmond for telling about ssh ... :)