[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ROOT created chaos !



In article <cistron.Pine.LNX.3.96.990223142756.1779B-100000@brahe.midco.net>,
Nathan E Norman  <finn@midco.net> wrote:
>On Wed, 24 Feb 1999, Bal K. Paudyal wrote:
>
> : As root, I typed the following:
> : 
> : "chsh /bin/usr/tcsh" when I meant "chsh /usr/bin/tcsh".
> : 
> : I just wanted to change the shell. But now because that shell file does not
> : exist, the system does not allow me to log in as root. I tried to log as su
> : but it does not work! There must be some way to change the things back!
>
>As your non-root user, type
>
>  su -s /bin/sh -c /usr/bin/chsh
>
>You will be prompted for the root passwd, and then the chsh command will
>run.

I changed the root shell to /bin/bash/nope, and tried this:

% su -s /bin/sh -c /bin/sh      
Password:
/bin/su: using restricted shell /bin/bash/nope
/bin/su: cannot run /bin/bash/nope: Not a directory

.. so that doesn't work. What you can do is boot the system in single
user mode. At the LILO prompt, hold down the shift key, press TAB
and see what your kernel is called (the first in the list). If it is
"linux", enter "linux single" and press enter.

The system will prompt you for the root password and should provide
you with a valid shell, because "sulogin" which is run at that point
has a lot of error-checking built in - it will notice that the root
shell isn't there and start /bin/sh instead.

Then you can use "chsh" or edit the password file to give root
a valid shell. Then logout with "exit" or Control-D and the system
will continue booting, after which you should be able to login
as root again.

HTH

Mike.
-- 
Indifference will certainly be the downfall of mankind, but who cares?


Reply to: