0

I have the following situation. I am working on my local computer A. I need to run code on a remote server C, which i can only access from remote server B. So to access C from A, i first connect with ssh to remote server B and then from there with ssh to server C.

I will have to send files back and forth quite often between A and C. What is an easy way to do this?

 Ssh connection:
 A->B->C

 Requested file transfers:
 A<->C
user3053216
  • 141
  • 1
  • 3
  • 6
  • What do you [think](https://superuser.com/questions/276533/scp-files-via-intermediate-host) about answer? – Isa Bek Dec 05 '17 at 09:14
  • @isaBek Thanks for the link, although honestly i am quite new to this and have no idea what those methods are, and why one would be better or worse to use in my case (frequent file exchange) – user3053216 Dec 05 '17 at 12:39

1 Answers1

0

Make a script on server "A" with connection initiation on server "B" and command sending that will connect your server "C" and send forward commands needed like "ARGS: %1 %2 %3 etc..."

See how to run command on another server here: "https://stackoverflow.com/questions/1041597/how-to-run-a-script-file-remotely-using-ssh"

Example: ssh user@serverB './scripts/ServerC_command.sh'

user1448914
  • 176
  • 1
  • 7
  • Thanks for the suggestion, but i have no idea how to add file transfer to that. – user3053216 Dec 05 '17 at 12:41
  • try to insert an " SCP (Secure CoPy) " to the script read more about here: https://www.shellhacks.com/copy-files-ssh-10-examples/ also http://www.hypexr.org/linux_scp_help.php – user1448914 Dec 06 '17 at 09:48