I'm trying to setup a chroot jail, but I'm not sure how to make this work in SSH and SFTP. A quick question, will something like this work for both SSH and SFTP or just SSH? If it doesn't work for both, how can I setup a chroot jail (or an alternative) to do so?


If SSH does a chroot, then it will be effective for all processes started by SSH.

  • So the answer is no? – APixel Visuals Aug 19 '18 at 4:16
  • @apxx since SFTP is handled by SSH, the answer is yes. In the post you linked, the accepted answer sets up an SFTP jail, disabling general SSH (note the ForceCommand internal-sftp). For general SSH access as well, you'd need something like unix.stackexchange.com/a/9854/70524. – muru Aug 19 '18 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.