Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Apr 2005 21:42:57 +0100
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        Olaf Stein <stein.175@osu.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: lock user to home directory
Message-ID:  <426D5651.3080104@dial.pipex.com>
In-Reply-To: <200504251959.j3PJxfks028300@defang9.net.ohio-state.edu>
References:  <200504251959.j3PJxfks028300@defang9.net.ohio-state.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?426D5651.3080104>