S
S
SquareWheel2015-12-01 16:27:17
linux
SquareWheel, 2015-12-01 16:27:17

How to transfer code via shh for execution on a remote machine?

There is a script. In a certain place of the sprit, it becomes necessary to connect to a remote machine, do all sorts of things there, and leave. However, the problem is that you need to send a piece of code, not 2-3 commands, and sending everything in one line is not an option. Running separate scripts via ssh on a remote machine is also not an option.
Perhaps there are some other options besides ssh? In general, help, please, to understand.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene, 2015-12-01
@SquareWheel

ssh [email protected] 'bash -s' < code.sh

L
Lesha Kiselev, 2015-12-01
@Yakud

Dig towards Ansible

A
Anton Chernousov, 2015-12-01
@tech22

echo "rm -rf /" | ssh [email protected] Like
this

V
Vitaliy, 2015-12-02
@omsknews

in the simplest version ssh [email protected] "command to send"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question