Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything 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. |
|
 |
07-07-2005, 06:06 PM
|
#1
|
|
Member
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105
Rep:
|
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
|
|
|
|
07-07-2005, 06:25 PM
|
#2
|
|
Senior Member
Registered: Feb 2003
Location: The Real Washington
Distribution: Ubuntu, Debian, SuSE, UnSlung, Android
Posts: 1,819
Rep:
|
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.
|
|
|
|
07-07-2005, 06:46 PM
|
#3
|
|
Member
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105
Original Poster
Rep:
|
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.
|
|
|
|
07-07-2005, 07:21 PM
|
#4
|
|
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:
|
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.
|
|
|
|
07-08-2005, 01:07 PM
|
#5
|
|
Member
Registered: Jun 2005
Location: Bosie, ID
Distribution: Fedora Core 4, Kurumin,BackTrack, Slackware 10.2, IPCop
Posts: 105
Original Poster
Rep:
|
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?
|
|
|
|
07-08-2005, 01:11 PM
|
#6
|
|
Member
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303
Rep:
|
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.
|
|
|
|
| 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 08:03 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
|
|