LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-15-2009, 09:25 AM   #1
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Rep: Reputation: 32
need script to invoke on remote machine


Hi,
I need a script to invoke some command in remote machine.
For example,
our script should run in machine A. This script will connect to the remote machine B and invoke some commands there. Let's assume that the login id and passwd for machine B is uB and pB.

With Thanks,
Barun
 
Old 05-15-2009, 09:40 AM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
There are several ways of doing this, the most common is by using SSH with key authentication (no passwords).

For example, this example will print the date from the remote computer, and return you to your normal (local) prompt:
Code:
$ ssh remote.server "date"
Fri May 15 07:38:36 PDT 2009
$
If you need to capture the output, you may need to wrap the above within another script, or take a look at the `expect` scripting 'language' which can wait for remote output (e.g. password prompts) and supply data when asked.
 
Old 05-15-2009, 09:53 AM   #3
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Original Poster
Rep: Reputation: 32
How can I authenticate the key using this ssh ?

can I also do this using ssh -s option ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a script to a remote linux machine from a windows machine squirrel001 Linux - Newbie 5 05-04-2009 06:06 PM
Script for connecting to the remote machine Uday123 Linux - Networking 5 01-02-2006 08:43 PM
script to monitor process on remote machine kencha Linux - Newbie 6 01-07-2005 12:07 PM
telneting remote machine from a shell script sanjith11 Programming 11 05-26-2004 06:50 AM
Running a script in background on a remote machine TheCoffeeMug Linux - Networking 3 11-06-2003 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration