Shell path for root incorrect

Oops. I was tryint to change my root shell to bash and I seem to have screwed up the path:

Code:
su
Password:
su: /bin/bash: No such file or directory

Of course, now I can't get into root to correct the path. How can I force my way into root and correct the root shell path? I'm running headless can't even reboot into single-user via ssh.
 
Oh my, how many times am I going to repeat myself and I explain to other people to keep the root's shell intact??

If you by any chance have security/sudo installed, that would be great for you, but I suppose you don't. Well then your only chance is to go and get your system into single user mode and fix it there.

Or if you're "lucky", you will be able to find a local root exploit for some of your software installed on your system ;-)
 
you don't, if you have physical access to that machine :)
 
Yeah, boot in single-user mode (menu option 4), accept the shell offered (/bin/sh), type [cmd=]mount -a[/cmd] at the prompt, and use [cmd=]chsh root[/cmd] to set the path to /usr/local/bin/bash. Better still: put the root shell back to /bin/csh, and use the toor account for root access, and give that account a bash shell. You'll be amazed at how fast you get used to typing [cmd=]su (-) toor[/cmd] instead of [cmd=]su (-)[/cmd]. Toor is a full root account, you won't see any difference.
 
Well, dropping into single-user didn't work. I'm going to reinstall 7.2 and start all over. No problem because I just installed it yesterday and didn't have much besides apache running. I will proselytize to all who will listen not to mess with the root shell.

I'm downloading 7.2 with BitTorrent and will burn a CD and re-install. Shouldn't take too long.
 
Aaron_VanAlstine said:
Well, dropping into single-user didn't work.
Why? It should work.

Do note that /bin/bash does NOT exist. Bash is not part of the base OS. If you do have bash installed via a port or package it'll be in /usr/local/bin/bash.
 
You can try this one:

$ su -m root -c /usr/local/bin/bash
Press ctrl+c and you have a bash :)
Then type # chsh and change the shell back to /bin/csh
 
I could drop into single-user, mount -a, but not update the shell path. It said chsh was an unrecognized command. In any event, I resinstalled from scratch and my web site is back on-line. It took about four hours but it was a useful learning experience and I appreciate all the help I received from this forum. I think FreeBSD has some of the best support in the open-source world.
 
DutchDaemon said:
Better still: put the root shell back to /bin/csh, and use the toor account for root access, and give that account a bash shell. You'll be amazed at how fast you get used to typing [cmd=]su (-) toor[/cmd] instead of [cmd=]su (-)[/cmd]. Toor is a full root account, you won't see any difference.

??
There are two root acounts?
 
Back
Top