Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-05-2006, 07:02 AM
|
#1
|
|
Member
Registered: Nov 2004
Posts: 63
Rep:
|
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
|
|
|
|
04-05-2006, 07:11 AM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,828
|
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...
|
|
|
|
04-05-2006, 01:53 PM
|
#3
|
|
LQ Newbie
Registered: Nov 2005
Distribution: Slackware
Posts: 23
Rep:
|
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.
Last edited by astorm; 04-05-2006 at 07:52 PM.
|
|
|
|
04-05-2006, 08:12 PM
|
#4
|
|
Member
Registered: Oct 2005
Location: Michigan
Distribution: Slackware
Posts: 162
Rep:
|
Look at rcp
|
|
|
|
04-06-2006, 01:38 AM
|
#5
|
|
Member
Registered: Nov 2004
Posts: 63
Original Poster
Rep:
|
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.
Last edited by alix123; 04-06-2006 at 01:40 AM.
|
|
|
|
04-06-2006, 01:44 AM
|
#6
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,828
|
you can run ssh within expect under cygwin
|
|
|
|
04-06-2006, 02:16 AM
|
#7
|
|
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
|
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
|
|
|
|
04-06-2006, 03:00 AM
|
#8
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,261
|
Yep, you can use auth_keys and call ssh using system() cmd or Net::SSH module.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:40 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|