Date: Tue, 14 Oct 2008 15:20:24 -0400 From: Jerry McAllister <jerrymc@msu.edu> To: Aniruddha <mailing_list@orange.nl> Cc: freebsd-questions@freebsd.org Subject: Re: Can't login as root after changing the shell to bash Message-ID: <20081014192024.GA8930@gizmo.acns.msu.edu> In-Reply-To: <1224008893.4098.6.camel@debian> References: <1224008893.4098.6.camel@debian>
next in thread | previous in thread | raw e-mail | index | archive | help
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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081014192024.GA8930>