From owner-freebsd-questions@FreeBSD.ORG Sat Dec 20 12:51:00 2003 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 D705316A4CE for ; Sat, 20 Dec 2003 12:51:00 -0800 (PST) Received: from inferno.eagle.ca (inferno.eagle.ca [209.167.16.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5590043D3F for ; Sat, 20 Dec 2003 12:50:59 -0800 (PST) (envelope-from iaccounts@northnetworks.ca) Received: from [192.168.1.102] (sfw2.eagle.ca [209.167.58.74]) by inferno.eagle.ca (8.12.8/8.12.3) with ESMTP id hBKKhMiE094409; Sat, 20 Dec 2003 15:43:22 -0500 (EST) (envelope-from iaccounts@northnetworks.ca) From: Steve Bertrand To: Mark McConnell In-Reply-To: <3FE419F1.7851.51B6193@localhost> References: <3FE419F1.7851.51B6193@localhost> Content-Type: text/plain Message-Id: <1071953267.258.3.camel@ptp.northnetworks.ca> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 20 Dec 2003 15:47:48 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-questions@Freebsd.org Subject: Re: bad root shell 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: Sat, 20 Dec 2003 20:51:00 -0000 On Sat, 2003-12-20 at 12:44, Mark McConnell wrote: > An error in a pw* script inserted a non-existent shell into the > password database, effectively locking out root. > > I used a fixit disk to correct the problem, using this procedure: > > 1. mount boot drive to /mnt > > 2. provide myself with a working mkdb and vi (for chpass): > # mkdir /usr/sbin /usr/bin > # ln -s /mnt/usr/sbin/pwd_mkdb /usr/sbin/pwd_mkdb > # ln -s /mnt/usr/bin/vi /usr/bin/vi > > 3. link pwd.db, spwd.db, group, passwd, master.passwd, ex: > # rm /etc/group /etc/spwd.db > # for i in `ls /mnt/etc/` ; do ln -s /mnt/etc/$i /etc/$i ; done > > 4. run mkdb > # /usr/sbin/pwd_mkdb master.passwd > > 5. Using chpass to change root's shell from `badshell' to csh > # chpass root > :s/badshell/\/bin\/csh/ > > All of this appears to do work without errors: > # pw usershow -u root > root:*:0:0::0:0:Charlie &:/root:/bin/csh > > However, when I log in as root, I am still locked out with the > message: > $ su > Password: ******** > badshell: No such file or directory > > I am still stupid. I am still locked out. /etc/passwd and > /etc/master.passwd no longer show the badshell. My configuration > appears to be deeply broken. Why does my procedure fail? > Just a thought, does /bin/csh live in /etc/shells? Is csh actually in the /bin directory? Is it executable? Perhaps try using /bin/sh for your shell. Steve > Mark > -- > Mark McConnell - Portland, OR > Technical Imaging Systems > markmc@tisimaging.com > 503-546-0517 > mkmcconn@hevanet.com > 503-257-7591 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"