Date: Mon, 22 Dec 2003 11:31:42 -0800 From: "Mark McConnell" <markmc@tisimaging.com> To: freebsd-questions@Freebsd.org Subject: Re: bad root shell Message-ID: <3FE6D61E.1090.5A243B@localhost> In-Reply-To: <pan.2003.12.21.04.32.20.822616@sremick.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FE6D61E.1090.5A243B>