[GH-ISSUE #193] Server to Server SCP through the bastion #47

Open
opened 2026-05-07 00:18:07 +02:00 by BreizhHardware · 3 comments

Originally created by @RomainL972 on GitHub (Jun 4, 2021).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/193

Hi,

We've been using The Bastion at our organization for some time and I noticed that it's not possible to use SCP to copy a file from one host on the bastion to another one also on the bastion. Is that a limitation of the software or is there some configuration needed ?

Thanks.

Originally created by @RomainL972 on GitHub (Jun 4, 2021). Original GitHub issue: https://github.com/ovh/the-bastion/issues/193 Hi, We've been using The Bastion at our organization for some time and I noticed that it's not possible to use SCP to copy a file from one host on the bastion to another one also on the bastion. Is that a limitation of the software or is there some configuration needed ? Thanks.
Author
Owner

@speed47 commented on GitHub (Jun 14, 2021):

Hello,

This is not supported (yet). I checked and it seems that when you type the following command from machine A:

user@A$ scp B:file C:file

This is what happens:

  • A connects through ssh to B, and launches the command scp file C:file on B
  • B connects through ssh to C, and launches the command scp -t

With a bastion between A and the rest of the infrastructure, this would mean:

  • A connects through the bastion to B, and launches the command scp file C:file on B
  • B connects directly through ssh to C (no bastion there), and launches the command scp -t

In both cases, this implies that B needs to have direct access to C.

I'll check if this can work with some minor adjustments to the code.

<!-- gh-comment-id:860544431 --> @speed47 commented on GitHub (Jun 14, 2021): Hello, This is not supported (yet). I checked and it seems that when you type the following command from machine `A`: `user@A$ scp B:file C:file` This is what happens: - A connects through ssh to B, and launches the command `scp file C:file` on B - B connects through ssh to C, and launches the command `scp -t` With a bastion between A and the rest of the infrastructure, this would mean: - A connects through the bastion to B, and launches the command `scp file C:file` on B - B connects directly through ssh to C (no bastion there), and launches the command `scp -t` In both cases, this implies that B needs to have direct access to C. I'll check if this can work with some minor adjustments to the code.
Author
Owner

@speed47 commented on GitHub (Jun 14, 2021):

This should be doable, however in the meantime, you should be able to do, if your bastion alias is bssh, instead of:

scp -S ~/scp_bastion server1:file1 server2:file2

Try this:

bssh server1 -- scp file1 server2:file2

It's functionally equivalent, and what happens under the hood if you use scp directly with 2 remote servers.
If you have the chance to test this with your setup, can you confirm it works?

<!-- gh-comment-id:860865976 --> @speed47 commented on GitHub (Jun 14, 2021): This should be doable, however in the meantime, you should be able to do, if your bastion alias is `bssh`, instead of: `scp -S ~/scp_bastion server1:file1 server2:file2` Try this: `bssh server1 -- scp file1 server2:file2` It's functionally equivalent, and what happens under the hood if you use `scp` directly with 2 remote servers. If you have the chance to test this with your setup, can you confirm it works?
Author
Owner

@RomainL972 commented on GitHub (Aug 19, 2021):

Hi, what I want to do is to download a file from a server behind the bastion, and to upload it to another server also behind the bastion, like what is shown here : https://unix.stackexchange.com/a/184435

<!-- gh-comment-id:902251420 --> @RomainL972 commented on GitHub (Aug 19, 2021): Hi, what I want to do is to download a file from a server behind the bastion, and to upload it to another server also behind the bastion, like what is shown here : https://unix.stackexchange.com/a/184435
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/the-bastion#47
No description provided.