From owner-freebsd-questions@FreeBSD.ORG Mon Apr 25 20:42:59 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7ACB316A4CE for ; Mon, 25 Apr 2005 20:42:59 +0000 (GMT) Received: from smtp-out5.blueyonder.co.uk (smtp-out5.blueyonder.co.uk [195.188.213.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B4E543D55 for ; Mon, 25 Apr 2005 20:42:58 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [82.41.37.55] ([82.41.37.55]) by smtp-out5.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Mon, 25 Apr 2005 21:43:36 +0100 Message-ID: <426D5651.3080104@dial.pipex.com> Date: Mon, 25 Apr 2005 21:42:57 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7) Gecko/20040627 X-Accept-Language: en, en-us MIME-Version: 1.0 To: Olaf Stein References: <200504251959.j3PJxfks028300@defang9.net.ohio-state.edu> In-Reply-To: <200504251959.j3PJxfks028300@defang9.net.ohio-state.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Apr 2005 20:43:36.0274 (UTC) FILETIME=[73FDDB20:01C549D7] cc: freebsd-questions@freebsd.org Subject: Re: lock user to home directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2005 20:42:59 -0000 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