I currently have an sftp-only sshd service running as an unprivileged user that works fine. When adding
ChrootDirectory %h
to the separate user_sshd_config, the user is immediately disconnected after successfully authenticating with publickeys and the error log shows the following:
fatal: server lacks privileges to chroot to ChrootDirectory [postauth]
The target directory is owned by the user running the process.

Is it possible to run a chroot'd sshd service running as an unprivileged user, or does the service have to have root permissions to perform a chroot operation?
Let me know if more information is needed, but from what I can see, all relevant information has been provided.


Alas, chroot(2) must be called as root.

| improve this answer | |
  • bummer, figured as much. thanks for the reply – n0x31891 Aug 21 '15 at 22:33

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.