Skip to content

Commit

Permalink
Merge pull request #2865 from phillxnet/2863-SFTP-user-chroot-shell-p…
Browse files Browse the repository at this point in the history
…ath-update-&-ls-addition

SFTP user chroot shell path update & ls addition #2863
  • Loading branch information
phillxnet authored Jul 9, 2024
2 parents 701b44c + cbdc9d5 commit 83030d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rockstor/system/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
),
}

PROGS_IN_CHROOT = ["/usr/bin/bash", "/usr/bin/rsync"]
PROGS_IN_CHROOT = ["/usr/bin/bash", "/usr/bin/rsync", "/usr/bin/ls"]


def sshd_config_opener(path, flags):
return os.open(path, flags, mode=stat.S_IRUSR | stat.S_IWUSR)
Expand Down Expand Up @@ -250,7 +251,7 @@ def rsync_for_sftp(chroot_loc):
# Copy libs for PROGS_IN_CHROOT to chroot
for lib in set(lib_list):
copy(lib, f"{chroot_loc}{lib}")
run_command([USERMOD, "-s", "/bin/bash", user], log=True)
run_command([USERMOD, "-s", "/usr/bin/bash", user], log=True)


def is_pub_key(key):
Expand Down

0 comments on commit 83030d1

Please sign in to comment.