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.
Printable View
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.
On 18 May 2004 11:13:51 -0700, Long wrote:[color=blue]
> 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.[/color]
I would boot the cd in the rescue mode and make the change.
On Tue, 18 May 2004 18:28:22 GMT, Bit Twister
<BitTwister@localhost.localdomain> wrote:
[color=blue]
>On 18 May 2004 11:13:51 -0700, Long wrote:[color=green]
>> 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.[/color]
>
>I would boot the cd in the rescue mode and make the change.[/color]
Assuming you can login as a regular user, then the easiest method
would be to use 'su'. For example:
su --shell=/bin/bash -
-Chris
Long wrote:
[color=blue]
> 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?[/color]
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.