Can't login as root after changing the shell to bash
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! -- Regards, Aniruddha ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
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. I can't explain why your systems says it can't find /usr/local/bin/bash. I would assume you also cannot log in as yourself. You should not change root's shell. I believe this has been discussed many times in the past on lists -- you should use tools like sudo or su2 to change UIDs. Both of those tools will allow you to take on root credentials while using the shell of your user account (bash). How can I fix this? I tried booting the freesbie cd but this wouldn't boot :(. Thanks in advance! You'll need to boot your machine and at the FreeBSD boot menu, choose option 4 for single-user mode. You'll eventually be dropped into a simple /bin/sh prompt. You'll need to do mount -a, then use vipw to edit all of the fields in /etc/master.passwd -- specifically, change root's shell back to /bin/csh. Write the file, exit vipw, and reboot the system. You should be up and working after that. -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
On Tue, 2008-10-14 at 11:37 -0700, Jeremy Chadwick wrote: 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. I can't explain why your systems says it can't find /usr/local/bin/bash. I would assume you also cannot log in as yourself. Thanks for your help! I changed the default shell back to /bin/csh but I still can't login as root?! I get the same message (can't find /bin/csh). -- Regards, Aniruddha ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
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 [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
On Tue, Oct 14, 2008 at 09:17:38PM +0200, Aniruddha wrote: On Tue, 2008-10-14 at 11:37 -0700, Jeremy Chadwick wrote: 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. I can't explain why your systems says it can't find /usr/local/bin/bash. I would assume you also cannot log in as yourself. Thanks for your help! I changed the default shell back to /bin/csh but I still can't login as root?! I get the same message (can't find /bin/csh). Your path is most likely screwed up.Probably it never got set correctly. Can you reboot? jerry -- Regards, Aniruddha ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
On Tue, Oct 14, 2008 at 09:17:38PM +0200, Aniruddha wrote: On Tue, 2008-10-14 at 11:37 -0700, Jeremy Chadwick wrote: 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. I can't explain why your systems says it can't find /usr/local/bin/bash. I would assume you also cannot log in as yourself. Thanks for your help! I changed the default shell back to /bin/csh but I still can't login as root?! I get the same message (can't find /bin/csh). I can't explain this. Possibly there's a permissions or ownership problem on the / directory (ls -ld / will show you that)? I've no idea; sounds odd. -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
On Tue, Oct 14, 2008 at 03:20:24PM -0400, Jerry McAllister wrote: 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 Note that he'll need to mount /var and /tmp for vi to work. Has to do with use of temporary files being placed in /tmp, and recovery files using /var/tmp/vi.recover. It's usually best to just do: # mount -a # mount -o rw -u / Which under ideal circumstances should take care of everything. -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Can't login as root after changing the shell to bash
On Tue, 2008-10-14 at 12:27 -0700, Jeremy Chadwick wrote: On Tue, Oct 14, 2008 at 09:17:38PM +0200, Aniruddha wrote: On Tue, 2008-10-14 at 11:37 -0700, Jeremy Chadwick wrote: 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. I can't explain why your systems says it can't find /usr/local/bin/bash. I would assume you also cannot log in as yourself. Thanks for your help! I changed the default shell back to /bin/csh but I still can't login as root?! I get the same message (can't find /bin/csh). I can't explain this. Possibly there's a permissions or ownership problem on the / directory (ls -ld / will show you that)? I've no idea; sounds odd. Sorry for the confusion. I just checked with vipw and somehow there got a dot behind /dev/csh :# Thanks for the help! I learned a lot. -- Regards, Aniruddha ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]