I have just added a new user in Debian but i am just wondering how i can restrict their access to other folders, really i just want them to stay in their own directory /home/username
feedback
|
migrated from stackoverflow.com Feb 25 '10 at 19:14
This question came from our site for professional and enthusiast programmers.
|
Unless you add someone to some other groups, the only place they will be able to create files is in /home/username/ and /tmp/. Any user who wants privacy can chmod their home directory 750 or 700 instead of the default 755, but that is for each user to decide. IIRC the root home directory permissions are enough to keep everything recursively inside that directory private. | |||
|
feedback
|
|
This is the default behaviour for Linux systems. You should be fine just leaving things how they are, but you may want to test and see if the restrictions are really in place by logging in as the new user and trying to change files outside the home directory. I would also like to say that they will be able to read configuration files in the /etc directory as well as other system files, but will not be able to see/modify the contents of other people's home directory. Note that sensitive system files (such as private keys for SSH) are only readable by root. | |||||||||||
feedback
|
|
there are many ways to do this, but if you really want to restrict them to their own home dir then you probably want a restricted shell solution. | |||
|
feedback
|
|
Edit /etc/passwd, and specify that they use a restricted shell, like rbash. They can then only execute commands from their PATH (which you can control), can't change the contents of PATH, and can't change directory. | |||
|
feedback
|
|
Chroot is a possible solution, but a drastic one, since you lose also the access to all /bin and such directories. We had a system set up for the students that had each home a ~/bin subdir with the needed programs in it and a login with chroot to ~ of the student. That worked well but it needed some preparation. Try this if you want the person to have VERY little access with or without the restricted shell. | ||||
|
feedback
|