Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix SCP support, but break jail. Proposing this change anyway as I really needed support for SCP from an embedded system (some modern systems somehow issue SFTP even when
scp
client is called).Unfortunately, OpenSSH allows jailing with SFTP by using a dirty hack -
internal-sftp
is a magic way to call internal SFTP process, allowing user to break the rules ofChrootDirectory
, which require a set of files to be under path specified (things like binary specified inForceCommand
and basic /dev nodes).At the same time,
internal-sftp
binary (/usr/lib/openssh/sftp-server
) completely delegates jailing/chrooting to OpenSSH and has no command-line options to restrict what it can read/write.On the other hand,
scp
can be somewhat jailed on its own (except symlinks, which should be doable by other tools on Linux) due to a fixed way it sends and receives files with-f
,-t
and-d
.Maybe some alternative SSH server should also be considered - I was originally hoping for the ability to
Match
selected subsystem and based on that set standard SFTP config or just leaveForceCommand
with proxy script for SCP.