LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   URGENT: How to execute a Linux command remotely (http://www.linuxquestions.org/questions/programming-9/urgent-how-to-execute-a-linux-command-remotely-431939/)

alix123 04-05-2006 08:02 AM

URGENT: How to execute a Linux command remotely
 
I want to execute a command remotely using perl script from windows to linux, for example

Assume that there is remote Linux machine say 192.168.251.19
i know the login and password of Machine as
login: root
password : root123

Now from the Remote Windows Machine with the above details I want to execute a command on linux say 'reboot' command or 'ps' command or any other command.

Is there any utility for windows/linux so that i can execute the commands remotely from windows (there should not be any user interaction required).

Basically i will be able to call that utility from my perl program if there are no user interaction,a kind of silent command execution

acid_kewpie 04-05-2006 08:11 AM

this is not urgent for anyone here, please do not expect people to jump to help you just because you felt you could use "URGENT" in the title...

astorm 04-05-2006 02:53 PM

Make sure you have an ssh daemon (sshd) running on the Linux machine and ssh to it from the Windows machine using PuTTY. Read the PuTTY manual for a more detailed explanation, although its UI is pretty straightforward.

I hope root123 is a fake password.

ckoniecny 04-05-2006 09:12 PM

Look at rcp

alix123 04-06-2006 02:38 AM

Using a Putty client requires User interaction
 
Using a Putty client requires User interaction. Which is problem for the autmated scripts.

I even tried the Command line version of putty i.e plink but it again requires user interaction to accept the key of the linux machine.

any other utility to exeucte the Remote linux command from windows silently (no user interaction) given the root user name and password.

acid_kewpie 04-06-2006 02:44 AM

you can run ssh within expect under cygwin

IBall 04-06-2006 03:16 AM

I am not sure if this works with Putty as well, but here are instructions on how to use ssh with no password prompt (At the bottom of the page). Basically, it is using a private / public key pair to do the authentication instead of a password.

I hope this helps
--Ian

chrism01 04-06-2006 04:00 AM

Yep, you can use auth_keys and call ssh using system() cmd or Net::SSH module.


All times are GMT -5. The time now is 11:09 PM.