From owner-freebsd-questions@FreeBSD.ORG Thu Sep 27 04:07:35 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EFA101065687 for ; Thu, 27 Sep 2012 04:07:34 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (nightmare.dreamchaser.org [12.32.44.142]) by mx1.freebsd.org (Postfix) with ESMTP id 375758FC1B for ; Thu, 27 Sep 2012 04:07:33 +0000 (UTC) Received: from breakaway.dreamchaser.org (breakaway.dreamchaser.org. [12.32.36.73]) by nightmare.dreamchaser.org (8.13.6/8.13.6) with ESMTP id q8R47W5L069956; Wed, 26 Sep 2012 22:07:32 -0600 (MDT) (envelope-from freebsd@dreamchaser.org) Message-ID: <5063D0FE.1080102@dreamchaser.org> Date: Wed, 26 Sep 2012 22:07:26 -0600 From: Gary Aitken User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120609 Thunderbird/13.0 MIME-Version: 1.0 To: Polytropon References: <5063A68A.8090107@dreamchaser.org> <20120927031849.f3496a43.freebsd@edvax.de> In-Reply-To: <20120927031849.f3496a43.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (nightmare.dreamchaser.org [12.32.36.65]); Wed, 26 Sep 2012 22:07:32 -0600 (MDT) Cc: FreeBSD Mailing List Subject: Re: bad root shell in /etc/passwd X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd@dreamchaser.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2012 04:07:35 -0000 Thanks, all. On 09/26/12 19:18, Polytropon wrote: > On Wed, 26 Sep 2012 19:06:18 -0600, Gary Aitken wrote: >> I mistakenly changed the root shell to something which doesn't exist. >> Was trying to make it bash and used /bin/bash instead of /usr/local/bin/bash. > > A typical Linuxism. :-) Never run on one enough to learn any of those. It's a dumbism, too-fast-with-the-fingersism, slow-functioning-brainism... > That's why you should be using the "toor" account and leave "root" > unchanged. I realized that about the time I learned I had given root to a bad shell path; at which time I also realized I hadn't given toor a pw. > Some may say that as soon as you're changing the root > shell because you're doing much work as root, you're obvuously > doing something wrong. :-) A (too) faint voice in the back of my head was saying that... > Also note that tools like su ("su -m", "su -") and super are > in many cases better suited for making the CLI environment more > comfortable than changing the shell of the root account. That's what I usually do, but I was (am) having trouble getting .shrc to actually take. Was modifying passwd to fix my own account, and decided to "fix" root at the same time -- I had changed it to csh and didn't think that was a good idea. At first changed it back to /bin/sh, and then decided to try bash as it should be a super-set. Although I think that is probably unwise. > Maybe without rebooting you can do this: Enter "su -m" (if your > non-root user is allowed to su root, then enter "chsh" and set > the root shell back to the default. su -m won't work because of the bad shell "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." > When you can successfully boot into SUM, you will be prompted for > the shell to start. /bin/sh is the default shell (even though it > is a quite ugly dialog shell -- still it's considered a "maintenance > and emergency use only shell" at this point. It will be powerful > enough to call the "chsh" command to get root back into normal > condition. chsh and vipw won't work from SUM until you mount /usr, which fortunately was all intact. back on the road again, thanks, Gary