Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.