-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFTP user chroot shell path update & ls addition #2863
Comments
Post having enabled sftp we have the following config for the specific user (owner of the share we sftp export):
With a necessary minor edit (remarking out) above this re the sftp subsystem line:
|
Once we setup a proposed
If we then attempt to ssh in as this user:
The result we receive is, as per our "ForceCommand internal-sftp" configuration":
See PR: "Configure SFTP server at buildtime and update customization settings. Fixes #2168" #2173 for the origin of this config development:
|
So given the last comment, our now inconsistent bash path, given the changes to our chroot introduced in #2858, has no current artifacts as we "ForceCommand" the internal-sftp as the user's 'shell'. However we may want to accommodate custom behaviour in the future that utilises our chroot setup. Doing a quick investigation of this now re: rockstor-core/src/rockstor/system/ssh.py Lines 143 to 154 in 701b44c
|
By way of testing a future modification re no or custom ForceCommand, if we remove the ForceCommand line, and stop/start all rockstor* services; then wipe/re-enable the same sftp-share export we end-up with the following config:
We end-up running into the issue anticipated bash path fail within our chroot:
|
If we correct the sftp-user shell path, stop/start all
This is a highly constrained shell, as intended, as we have only bash and rsync binaries (plus lib dependencies) accessible: but that is outside the scope of this issue. I.e.:
but we have our intended rsync binary available:
We also see in our Web-UI the sftp-user's Shell entry as follows:
|
By way of providing at least
Assuming the proposed user intervention of removing our overarching constraint of the "ForcedCommand" limitation for all SFTP users. |
Correct currently ineffectual BASH path in SFTP chroot setup. Default sshd user specific config: via SFTP Share export, enforces `ForceCommand internal-sftp`, however future enhancements (or current by-hand "ForceCommand ..." removal) results in a chroot failure for SFTP enabled users accessing via SSH.
…ath-update-&-ls-addition SFTP user chroot shell path update & ls addition #2863
Closing as: |
During #2858's development, it was noted that we have the following shell setup enforced for SFTP users:
rockstor-core/src/rockstor/system/ssh.py
Line 253 in ce44243
I.e. we modify the SFTP user's shell to
/bin/bash
which is likely now inconsistent with the new chroot environment setup by way of SFTP configuration.Reproducer of consequent behaviour to follow.
The text was updated successfully, but these errors were encountered: