Activating Bash scripts over the network

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

Activating Bash scripts over the network

#1 Post by Pete »

Hi all

I have a need to start (and stop) existing Bash scripts on several Puppy machines from one "master".

It is a local network (static I.P.) with me as the only user so security is a low priority.

Any thoughts to what I should use to invoke the scripts?
Netcat? Netpipes?

Please note that I need to start the scripts as required and not at fixed times
so cron is of no use and VNC will be a total overkill.

T.I.A.

User avatar
6502coder
Posts: 677
Joined: Mon 23 Mar 2009, 18:07
Location: Western United States

#2 Post by 6502coder »

Won't remote shell (rsh) do the job?

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#3 Post by greengeek »

Hi Pete,

I have no experience of this kind of thing but I do recall reading some threads about similar remote control. Maybe have a look at these posts:

http://www.murga-linux.com/puppy/viewtopic.php?t=90129

http://murga-linux.com/puppy/viewtopic.php?t=90098

and a couple of older threads:
http://www.murga-linux.com/puppy/viewto ... 1ac5886608

http://www.murga-linux.com/puppy/viewtopic.php?t=31702

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#4 Post by Pete »

@6502coder

Not a bad idea, will give it a try.

@greengeek

Thanks for the links, will check them out.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#5 Post by Pete »

Right, decided to stick with netcat (nc) as it's available on most (if not all) Puppies so no extra software required, works with the CLI or under the GUI and lastly, it's a breeze to use.

Thanks all for your ideas and suggestions.

Note to those thinking of also using netcat:

By itself it's very insecure, I use it simply because it's a "closed" network where I am the only user.
If you need extra security, then rather use rsh/ssh as 6502coder suggested or one of the VNC programs listed in greengeek's post.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

Pete wrote:Right, decided to stick with netcat
Netcat is a file transfer utility. I don't understand how you plan to remotely start/stop scripts with it.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#7 Post by Pete »

Netcat can transfer files but can also do much more.

To name a few....
Can generate network traffic for fault-finding.
Can be used to contact web servers to check for response headers.
Can be used for streaming of video and audio files.

...and last but not least, can be used to activate a remote shell on which we can execute commands and scripts.

Example to execute scripts and/or commands:

On remote machine, start a script like such that keeps netcat open and listening for connections:

Code: Select all


#!/bin/sh

while [ 1 ]
do
nc -l -p 22000 -e /bin/sh
done

Then on the "master" computer enter the following:

Code: Select all

nc The_IP_of_the_remote_pc 22000
So now one can execute commands as if on the other computer or even start scripts.

Note that by default, std out is fed back to the "master" computer, whilst std error is displayed on the local computer.

Also be aware that the nc on puppy (busybox) seems to be a slimmed down version of the real nc with less features but still very usable.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#8 Post by greengeek »

Thanks for the nc info. Good to know. Just want to point out that RDP is not a type of VNC - it's apparently a "terminal services client" see wiki entry
Differences between RDP and VNC are discussed here and here, and there is a useful youtube comparison here.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#9 Post by Pete »

@greengeek

Thanks for that.
I always thought of RDP and VNC as pretty much the same thing but now
know that RDP can actually be more efficient at times since it is "aware" of things like fonts and other gui components as opposed to just sending the whole screen as a graphic.

Post Reply