P
P
pashaxp2013-05-22 15:21:39
linux
pashaxp, 2013-05-22 15:21:39

Remote script execution?

Greetings, omniscient Habr!
What is given: there is a server on Debian 6 x64 (I think this is not essential, but I write for completeness of information). Let's call it main . It has 1 white network interface. Let us have a white IP - 1.2.3.4. And there are 2 interfaces with gray addresses. Let them be 192.168.0.3 and 192.168.10.3.
In each of the gray subnets there are other servers (they are not accessible from the world), with the same OS. You can access them via ssh.
What you need: how can you remotely run scripts (bash) that will be contained on them on other servers from the gray networks from the main server in the easiest way?
It is advisable to arrange this also in the form of a bash script, which lies on main, so that you can log in to it, and execute it from the console, and then the scripts will run on each of the servers in the gray networks.
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
truekenny, 2013-05-22
@pashaxp

ssh server.addr 'command;command'

A
AgentSIB, 2013-05-22
@AgentSIB

Remotely, you can run a command / script via ssh, for example, do
ssh [email protected] command
Authentication on each server by key. You can also set the desired script right after authorization by key (if you applied with this key, then immediately run the script), this is more secure.
For example ~/.ssh/authorized_keys on the remote server
command="COMMAND OR SCRIPT",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-dss KEY

M
MrFrizzy, 2013-05-22
@MrFrizzy

And put on main a script that goes to the machines of gray networks via ssh and does its job?
I do the same with python + fabric.

D
Dmitry Smirnov, 2013-05-22
@DimaSmirnov

saltstack.org - remote execution daemon
here is a brief overview of remote script execution - docs.saltstack.com/#remote-execution , follow the links for more details.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question