Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to link the root directory / to the user's home directory $HOME in Linux? I want to restrict the user's access to the system, the long way would be to wrap each gnu core util in an argument parser and change all the absolute paths to $HOME/... instead of /... but that would be painful. There has to be an easier, and more universal way... right?

share|improve this question
up vote 3 down vote accepted

I believe the answer to your question is in the chroot(2) system call. You can designate the user's login shell as a utility that does the appropriate chroot(2) for that user and execs a shell. The filesystem visible to the user would be what was setup in the chroot(2).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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