howto lock user in his home folder in ubuntu desktop OS

link|improve this question
1  
Don't give them root access? – Phoshi Apr 24 '10 at 10:33
feedback

3 Answers

Considering that for directories the permissions bits do the following:

  • read: grants the ability to read the names of files in the directory.
  • write: grants the ability to modify entries in the directory.
  • execute: grants the ability to traverse its tree in order to access files or subdirectories.

you could change the permissions of the "others" user of the directories in the filesystem that you want to quarantine from the user.

While in theory this solution should work, I did not tested it and I can't say that there would be no problems involved.

link|improve this answer
feedback

You could chroot their home directory, then they would not be able to see anything below that.

link|improve this answer
configuring a chroot jail isn't a simple (or space-efficient) process. – quack quixote Apr 24 '10 at 15:12
feedback

You might consider aliasing the cd command to check for this. I don't have a full solution for this, but you could edit their .bashrc so that their cd would execute some script you make. Your script could then ensure that the directory resulting from the command is a child of their own home path. (Be sure to check symbolic links too for work-arounds.) You'll then have to remove write access to .bashrc to cement your changes.

To avoid allowing a user to list other directories you must remove the 'x' flag from other directories. To make this the default behavior you should use umask. A quick search on this site should give you some good examples.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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