P
P
PoliceDogs2018-07-01 01:50:34
linux
PoliceDogs, 2018-07-01 01:50:34

How to redirect ssh commands?

Hello, how to transfer ssh commands from one server to another?
There are 2 servers (let's say vps1 and vps2). It is necessary to make sure that the client connects via ssh to vps1, but all entered commands must be transferred and executed on vps2. At the same time, it is desirable, without visible changes for vps1. Roughly speaking, vps1 acts as a proxy, so to speak. Many thanks in advance for your answers :)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
key don, 2018-07-01
@keydon2

But it's in the mana! How do you use software without at least reading man ssh?
ssh -A vps1
ssh vps2
echo $HOSTNAME

V
Viktor Belsky, 2018-07-01
@Belyj

You can forward a tunnel through ssh if port forwarding is enabled on vps1 (it is enabled by default)
ssh -f -N -L 22022:vps2:22 [email protected]
ssh -p 22022 [email protected]

S
Saboteur, 2018-07-01
@saboteur_kiev

rsh server1 "rsh server2 cmd"

H
Human_Jan, 2018-07-09
@Human_Jan

Use ansible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question