View Single Post

   
  #8 (permalink)  
Old 02-19-2008, 07:19 AM
Alan Connor
 
Posts: n/a
Default Re: Lock users in home directories?

On Wed, 07 Jan 2004 08:01:25 GMT, Alan Connor <zzzzzz@xxx.yyy> wrote:
>
>
> On Tue, 6 Jan 2004 01:04:11 +0100, Morten Lundstrøm <semizealot@iname.hej> wrote:
>>
>>
>> Hi
>>
>> Is there a way to lock users in their home directories allowing them only to
>> access sub directories in their home dir and a directory with tools that
>> i've specified?
>> I've tried but can't figure it out :-|
>>
>> Thanks
>> Morten
>>

>
> You can replace their shell in /etc/passwd with a script that will permit
> only certain commands to be run.
>
> A case menu would work very well for this purpose.
>
> Choose one these commands or log out....
>
> trap "kill -9 $$" INT TSTP
>
> would keep them from using Ctrl-c or Ctrl-z to get out of the menu
>
>
> AC
>



Actually, it would be fairly easy to write a script that would present what
LOOKED like a regular prompt, but would check every command before running
and return an error message for any cd command not in the home directory,
and any command that tried to OPERATE on a file not in the home directory.

You'd need to alias some commands like vi so that they couldn't
access external commands, deny them the use of some, and make the user's
..bashrc and .bash_profile owned by root, but that's not a big deal.

AC

Reply With Quote