[GH-ISSUE #154] SFTP/SCP through Bastion #33

Closed
opened 2026-05-07 00:17:51 +02:00 by BreizhHardware · 6 comments

Originally created by @roybj on GitHub (Mar 6, 2021).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/154

The Bastion works fine for managing SSH connections. But is there way to manage SFTP/SCP through the bastion ?

Originally created by @roybj on GitHub (Mar 6, 2021). Original GitHub issue: https://github.com/ovh/the-bastion/issues/154 The Bastion works fine for managing SSH connections. But is there way to manage SFTP/SCP through the bastion ?
Author
Owner

@speed47 commented on GitHub (Mar 8, 2021):

Yes there is, for SCP.

Even if all the needed information is in the above documentation of the scp plugin, this should probably get a specific howto documentation page with examples. The key takeaways are:

  • One should have SSH access through the bastion (via personal or group access) to some host to be able to scp from/to it
  • One should also have the explicit scp access to this host, via the same way that its SSH access to it (personal or group), those kind of accesses can be added/removed with --scpup and --scpdown (instead of --user) in the groupAddServer and accountAddPersonalAccess commands
  • One must get its personalized scp script by running the --osh scp plugin
  • Then use scp with the script, scp -S ~/scriptpath <usual scp commands>
<!-- gh-comment-id:792617697 --> @speed47 commented on GitHub (Mar 8, 2021): Yes there is, for [SCP](https://ovh.github.io/the-bastion/plugins/open/scp.html). Even if all the needed information is in the above documentation of the scp plugin, this should probably get a specific *howto* documentation page with examples. The key takeaways are: - One should have SSH access through the bastion (via personal or group access) to some host to be able to scp from/to it - One should **also** have the explicit scp access to this host, via the same way that its SSH access to it (personal or group), those kind of accesses can be added/removed with `--scpup` and `--scpdown` (instead of `--user`) in the `groupAddServer` and `accountAddPersonalAccess` commands - One must get its personalized scp script by running the `--osh scp` plugin - Then use scp with the script, `scp -S ~/scriptpath <usual scp commands>`
Author
Owner

@dwydler commented on GitHub (Mar 8, 2021):

@speed47
As i read/understand it correct the solutions is primary for linux workstations.
Do you have a workaround/suggestion for windows workstations?

<!-- gh-comment-id:792633016 --> @dwydler commented on GitHub (Mar 8, 2021): @speed47 As i read/understand it correct the solutions is primary for linux workstations. Do you have a workaround/suggestion for windows workstations?
Author
Owner

@roybj commented on GitHub (Mar 8, 2021):

Yes there is, for SCP.

Even if all the needed information is in the above documentation of the scp plugin, this should probably get a specific howto documentation page with examples. The key takeaways are:

  • One should have SSH access through the bastion (via personal or group access) to some host to be able to scp from/to it
  • One should also have the explicit scp access to this host, via the same way that its SSH access to it (personal or group), those kind of accesses can be added/removed with --scpup and --scpdown (instead of --user) in the groupAddServer and accountAddPersonalAccess commands
  • One must get its personalized scp script by running the --osh scp plugin
  • Then use scp with the script, scp -S ~/scriptpath <usual scp commands>

You're right , I already have checked and SCP works fine from the command line.

<!-- gh-comment-id:792765336 --> @roybj commented on GitHub (Mar 8, 2021): > Yes there is, for [SCP](https://ovh.github.io/the-bastion/plugins/open/scp.html). > > Even if all the needed information is in the above documentation of the scp plugin, this should probably get a specific _howto_ documentation page with examples. The key takeaways are: > > * One should have SSH access through the bastion (via personal or group access) to some host to be able to scp from/to it > * One should **also** have the explicit scp access to this host, via the same way that its SSH access to it (personal or group), those kind of accesses can be added/removed with `--scpup` and `--scpdown` (instead of `--user`) in the `groupAddServer` and `accountAddPersonalAccess` commands > * One must get its personalized scp script by running the `--osh scp` plugin > * Then use scp with the script, `scp -S ~/scriptpath <usual scp commands>` You're right , I already have checked and SCP works fine from the command line.
Author
Owner

@roybj commented on GitHub (Mar 8, 2021):

@speed47
As i read/understand it correct the solutions is primary for linux workstations.
Do you have a workaround/suggestion for windows workstations?

Exactly, I would also like to know if Windows, specially clients like WinSCP are supported or not.

<!-- gh-comment-id:792765791 --> @roybj commented on GitHub (Mar 8, 2021): > @speed47 > As i read/understand it correct the solutions is primary for linux workstations. > Do you have a workaround/suggestion for windows workstations? Exactly, I would also like to know if Windows, specially clients like WinSCP are supported or not.
Author
Owner

@speed47 commented on GitHub (Mar 9, 2021):

Correct, I was explaining this with the command line in mind.
From Windows, it should also work out of the box from WSL (through Ubuntu or any other Linux OS installable under WSL).

Unfortunately I'm not expecting this to work with WinSCP or other similar software, as I see no way of "hooking" into its SSH negociation to handle the bastion stuff under the hood. This is what the -S command-line option of scp is for, and AFAIK it's not implemented in any Windows GUI apps.

<!-- gh-comment-id:793602116 --> @speed47 commented on GitHub (Mar 9, 2021): Correct, I was explaining this with the command line in mind. From Windows, it should also work out of the box from WSL (through Ubuntu or any other Linux OS installable under WSL). Unfortunately I'm not expecting this to work with WinSCP or other similar software, as I see no way of "hooking" into its SSH negociation to handle the bastion stuff under the hood. This is what the `-S` command-line option of `scp` is for, and AFAIK it's not implemented in any Windows GUI apps.
Author
Owner

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

This is now part of the documentation.

<!-- gh-comment-id:871517769 --> @speed47 commented on GitHub (Jun 30, 2021): This is now [part of the documentation](https://ovh.github.io/the-bastion/using/scp.html).
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#33
No description provided.