From owner-freebsd-questions@FreeBSD.ORG Mon Dec 22 11:31:44 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 AAE3416A4CE for ; Mon, 22 Dec 2003 11:31:44 -0800 (PST) Received: from integraonline.com (mail-7.integraonline.com [206.163.82.94]) by mx1.FreeBSD.org (Postfix) with SMTP id 8184C43D54 for ; Mon, 22 Dec 2003 11:31:43 -0800 (PST) (envelope-from markmc@tisimaging.com) Received: (qmail 9612 invoked from network); 22 Dec 2003 19:31:42 -0000 Received: from unknown (HELO Eeyore) (?pbs?brianasher.tisimaging.com@199.107.164.126) by 0 with SMTP; 22 Dec 2003 19:31:42 -0000 From: "Mark McConnell" To: freebsd-questions@Freebsd.org Date: Mon, 22 Dec 2003 11:31:42 -0800 MIME-Version: 1.0 Message-ID: <3FE6D61E.1090.5A243B@localhost> Priority: normal In-reply-to: X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body 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: Mon, 22 Dec 2003 19:31:44 -0000 su -m only works when you have a bad shell, if your uid is 0 su(1) -m Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precaution, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non- zero, su will fail. But otherwise, yours would be the right answer, I believe. Mark -- On 20 Dec 2003 at 23:32, Scott I. Remick wrote: {Re: bad root shell...}: > On Sat, 20 Dec 2003 09:44:17 -0800, 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: > > Unless I'm missing something, seems like the long way to do this. Last > time I did this to myself, I did the following: > > 1) Log in as a user who can su to root. > 2) Use su -m to su to root without changing your current shell > 3) As root, use chpass -s to change your shell to a working one. > > Of course, this won't work if your only account is "root" or you don't > have anyone else in the wheel group, so maybe it doesn't apply to you. > > _______________________________________________ > 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" > Mark McConnell - Portland, OR Technical Imaging Systems markmc@tisimaging.com 503-546-0517 mkmcconn@hevanet.com 503-257-7591