LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-07-2005, 06:06 PM   #1
issinho
Member
 
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105

Rep: Reputation: 15
Remote Execution


What I'm looking for is a way to execute a script that resides on another system. I want to login in, execute the script, and logout. The Script (that I need to execute ) already resides on the remote machine.

If someone could come up with some help for me, I would really appreciate it. SSH is not a problem, by the way
 
Old 07-07-2005, 06:25 PM   #2
Pcghost
Senior Member
 
Registered: Feb 2003
Location: The Real Washington
Distribution: Ubuntu, Debian, SuSE, UnSlung, Android
Posts: 1,819

Rep: Reputation: 46
If ssh is not a problem you should be set. SSH into the machine, type

./myscript.sh &

and logout. The & will start it as a background process, and should keep it running after you log out. Obviously replace "myscript.sh" with the name of your script.

Last edited by Pcghost; 07-07-2005 at 06:26 PM.
 
Old 07-07-2005, 06:46 PM   #3
issinho
Member
 
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105

Original Poster
Rep: Reputation: 15
Well, here's the deal.

I need to be able to execute the script remotely without going through the whole logging in mess.
The reason behind all this is that I have to execute this same script on multiple machines and I want an easier way of accomplishing it.
 
Old 07-07-2005, 07:21 PM   #4
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
I've got my firewall set up like that. I made a user dialout d added the script to it's .bash_proofile . Iset up ssh to se keys instead of passwords so I just:

ssh dialout@192.168.1.1

and it logs in and runs my script to connect and share the internet.

btw I mapped the command to a key on my keyboard so I can press one key and run the script on the remote computer.

Last edited by johnson_steve; 07-07-2005 at 07:23 PM.
 
Old 07-08-2005, 01:07 PM   #5
issinho
Member
 
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105

Original Poster
Rep: Reputation: 15
Reply

Well, here's the deal:

the script is located on the remote computer.

I want to write a second script that will login, run the remote script, and log out.

Is this possible?
 
Old 07-08-2005, 01:11 PM   #6
demian
Member
 
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
Create a (passwordless) ssh key and bind it to the command you want to run (by prepending the key with "command=/path/to/your/script" in ~/.ssh/authorized_keys). Then run ssh -i ~/.ssh/key_you_created user@host.

alternatively you can go without keys and just run ssh user@host /path/to/your/script

Last edited by demian; 07-08-2005 at 01:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
rcmd for remote execution shivaligupta Linux - Networking 3 06-10-2005 06:19 AM
How to tell where the execution is going on right now? bahadur Programming 7 04-03-2005 03:42 AM
Thorny remote execution question davidcrawley Linux - Software 3 09-03-2004 02:32 PM
Remote Command Execution via mobile phone Sammy2ooo Linux - Software 6 06-27-2003 03:42 AM
Java... execution ? gluon Programming 2 02-08-2002 01:13 PM


All times are GMT -5. The time now is 05:17 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration