lock user to home directory

Alex Zbyslaw xfb52 at dial.pipex.com
Mon Apr 25 13:42:59 PDT 2005


Olaf Stein wrote:

>- bash is installed
>- if I run chpass -s /usr/local/bin/bash -r username chpass says
>chpass: illegal option -- r 
>I guess because of the blank
>
>- if I run chpass -s /usr/local/bin/rbash chpass says:
>chpass: WARNING: shell '/usr/local/bin/rbash' does not exist
>Which also makes sense as there is no file rbash in that directory
>
>I get the same warning if I try /usr/local/bin/bash-r
>
>If I change it back to /usr/local/bin/bash it wokrs fine
>
>
>All this makes sense, the problem is that I do not know how I could change a
>users shell adding the "-r" argument
>  
>
You are right, you cannot pass arguments to the shell (such as -r) from 
the passwd file.  It looks like rbash is not installed by default by the 
port so you'll just need to make a link or symlink from bash->rbash

  cd /usr/local/bin
  ln -s bash rbash

 From the bash man page:

       If  bash  is  started with the name rbash, or the -r option is 
supplied at
       invocation, the shell becomes restricted.

And much more detailing what it does.  Whether it's what you really want 
is another matter...  It looks to me like it does a heck of a lot more 
than you originally wanted, but might still suit your purposes.

--Alex




More information about the freebsd-questions mailing list