From owner-freebsd-questions@FreeBSD.ORG Tue Oct 14 19:22:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E782C1065698 for ; Tue, 14 Oct 2008 19:22:44 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 623EB8FC08 for ; Tue, 14 Oct 2008 19:22:44 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id m9EJKORL009064; Tue, 14 Oct 2008 15:20:24 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id m9EJKOej009063; Tue, 14 Oct 2008 15:20:24 -0400 (EDT) (envelope-from jerrymc) Date: Tue, 14 Oct 2008 15:20:24 -0400 From: Jerry McAllister To: Aniruddha Message-ID: <20081014192024.GA8930@gizmo.acns.msu.edu> References: <1224008893.4098.6.camel@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1224008893.4098.6.camel@debian> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Can't login as root after changing the shell to bash X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 19:22:45 -0000 On Tue, Oct 14, 2008 at 08:28:13PM +0200, Aniruddha wrote: > I tried to change the root's shell to bash. I used this command: 'chsh > -s /usr/local/bin/bash'. Prior to changing the shell for root I did it > for my user account using the same command without problems. > Unfortunately after a reboot I can't login as root anymore because my > system can't find /usr/local/bin/bash. How can I fix this? I tried > booting the freesbie cd but this wouldn't boot :(. Thanks in advance! Sounds like /usr/local/bin is either not in the path for root or that the /usr or /usr/local file system is not mounted - which would be true in a single user boot. You should never change root's shell. It is doable if you move some files around, but it is too likely that you will come up with a situation like this where the alternate shell is not available. You can try coming up in 'single user' mode. Older systems required you to hit the space bar within the countdown. Newer ones require you to select the right option from a menu. I think it is '4' but don't want to reboot at the minute to check. It will ask you which shell you want. Just take the default (eg hit ENTER). Then remount / by doing: mount -u / Then edit /etc/passwd using the vipw(8) utility - just type: vipw It is just like using vi. Change your shell back to /bin/csh The shell is the last field in the line for the root account. Then, either reboot or just exit the single user mode and come up in full boot. If you absolutely must degenerate to using bash on a root account, create another root acount. Just go in to vipw and copy the root account line and replace the fields needed - namely the id, the name stuff, the login directory and the shell field. Of course, do not change the original root line. Suggestion, for example, if your usual account might be clyde, then make a root account called Rclyde. Make a home directory of /root/Rclyde. Don't forget to go and create that directory. It you can live without making that alternate root account, it is better to log in with your non-root account and then su(1) to get to root. Don't forget to add your non-root account to the 'wheel' group. Edit the /etc/group file. This is safer than logging in over the net directly to a root account because you can make sure your transmissions are encripted before going in to root. ////jerry > -- > Regards, > > Aniruddha > _______________________________________________ > 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"