booting to single user - Linux
This is a discussion on booting to single user - Linux ; Hello all -
I edited the /etc/passwd file for root from bash to ksh and now can't
log into the machine. How can I boot into single user mode to edit
/etc/passwd for root back to bash? Appreciate your help....
-
booting to single user
Hello all -
I edited the /etc/passwd file for root from bash to ksh and now can't
log into the machine. How can I boot into single user mode to edit
/etc/passwd for root back to bash? Appreciate your help.
-
Re: booting to single user
On 18 May 2004 11:13:51 -0700, Long wrote:
> Hello all -
> I edited the /etc/passwd file for root from bash to ksh and now can't
> log into the machine. How can I boot into single user mode to edit
> /etc/passwd for root back to bash? Appreciate your help.
I would boot the cd in the rescue mode and make the change.
-
Re: booting to single user
If using lilo you can do something like:
linux root=/dev/hdxx rw init=/bin/bash
And this will give you a prompt where you can do anything you wish.
Tommy
On 2004-05-18, Long wrote:
> Hello all -
> I edited the /etc/passwd file for root from bash to ksh and now can't
> log into the machine. How can I boot into single user mode to edit
> /etc/passwd for root back to bash? Appreciate your help.
-
Re: booting to single user
On Tue, 18 May 2004 18:28:22 GMT, Bit Twister
wrote:
>On 18 May 2004 11:13:51 -0700, Long wrote:
>> Hello all -
>> I edited the /etc/passwd file for root from bash to ksh and now can't
>> log into the machine. How can I boot into single user mode to edit
>> /etc/passwd for root back to bash? Appreciate your help.
>
>I would boot the cd in the rescue mode and make the change.
Assuming you can login as a regular user, then the easiest method
would be to use 'su'. For example:
su --shell=/bin/bash -
-Chris
-
Re: booting to single user
Long wrote:
> I edited the /etc/passwd file for root from bash to ksh and now can't
> log into the machine. How can I boot into single user mode to edit
> /etc/passwd for root back to bash?
Changing root's shell from bash to ksh should not cause these problems
normally. I do this all over the place, actually.
However, there are always caveats. First, make sure that all dynamic
libraries are on / if you are using a dynamically linked executable.
The usual culprit is libraries in /usr/lib, and /usr not being mounted
at boot.
Secondly, make sure that the shell is in /etc/shells.
I normally install pdksh and convert all users to /bin/ksh, and usually
root as well.
To be extra careful, you might wish to make /bin/ksh a static
executable, but that would require compiling it from scratch probably.
Also remember to edit your password file by using vipw - or better yet,
log in as root and use chsh to change your shell.
Also, when making such a change, leave a root shell active and test the
login from somewhere else (like another terminal). This would help you
to avoid such troubles.