0

I'm trying to execute a command from Server 1 through server 2 on a machine that's on the outside world is this possible via ssh tunnel forwarding? I made a little drawing as an example.

enter image description here

I've tried it with

ssh -L PORT:IP:PORT user@remotemachine "hostname"

When i try this i get the wrong hostname back

  • 1
    Does this answer your question? [ssh TOTP connection with jump host forwarding](https://serverfault.com/questions/1082943/ssh-totp-connection-with-jump-host-forwarding) – Gerald Schneider Jul 27 '22 at 11:21

1 Answers1

0

ProxyJump function of SSH should be able to do what you need. Basically your server 2 would be the jump station to reach your server 3. You have a good article available on redhat's website : https://www.redhat.com/sysadmin/ssh-proxy-bastion-proxyjump

SBO
  • 544
  • 1
  • 5
  • 12