LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't login after removing zsh shell (https://www.linuxquestions.org/questions/linux-newbie-8/cant-login-after-removing-zsh-shell-318037/)

fdac 04-28-2005 07:37 AM

can't login after removing zsh shell
 
Hi,

I've recently installed Debian on an old Pentium box I had lying around. Not my very first foray into Linux but I'm definitely still a newbie.

I used apt-get to install zsh, a replacement for the standard shell (bash?) to try out zsh.

In the meantime, using zsh, I upgraded the distro to Sarge, again with apt-get, and have played with a few other settings which I don't think are related.

Here is the silly part: I decided not to continue with zsh, so did a quick
Code:

apt-get remove zsh
.

When I next rebooted, everything was ok, got to the debian login prompt, but I cannot log in as root or as normal user. For obvious reasons, I get the error message:
Code:

Cannot execute /bin/zsh: No such file or directory
when I try to login.

Obviously I should have changed a config file somewhere so that the normal shell is loaded by default, since zsh no longer exists on my system. I've tried several rescue disk systems but have had no success - either I get back to the same broken login prompt or I can't boot at all.

Any suggestions on:
(a) how can I boot the system and access my hard drive to fix it, and
(b) what file do I need to edit once I achieve (a) ??

Cheers
Francis

Technoslave 04-28-2005 09:26 AM

Login as root and change it. After all, you were logging in as your regular user and just using sudo for things root related, right?

Otherwise, create a boot CD and change your entry in /etc/passwd to reflect the shell you want to go back to.

fdac 04-28-2005 08:09 PM

Thanks for the reply.

Yes, I log in as a regular user and sudo as required for root - as I recall that included using apt-get as root. I think that
Code:

sudo apt-get install zsh
must have automagically changed the setting for root as well as the user.

I made a bootable Debian CD when I installed the distro. I can boot using
Code:

boot: rescue root=/dev/hda1
but this gets me back to the same login prompt.

At the prompt I can not log in as root or as a normal user, suggesting that both the user account and root are set up to use zsh.

I think what I need to do is load a different root filesystem from a floppy or CD, then mount /dev/hda1 from the temporary filesystem so I can change the setting. I've tried 'tomsrtbt' and others with no success - when I write the floppy disk images from my Win98 box, using rawritewin, Linux doesn't recognise a valid root filesystem.

Thanks for pointing me in the direction of /etc/passwd - now at least I know what to fix when I get there!

I'll post again when I get it fixed.

Cheers
Francis

Technoslave 04-29-2005 09:32 AM

When you make a bootable debian CD and you boot off of it, it should bring you to a point where it wants to start installing from CD. Cut to another terminal should give you a bash shell. From there you'll mount your old file system and change the entry.

Doing an apt-get for a new shell shouldn't have changed anything...odd.

fdac 04-30-2005 09:57 AM

Fixed!
 
Thanks Technoslave - problem now solved!

What I had been doing with the rescue CD was typing 'rescue root=/dev/hda1' when I should have just pressed enter to boot the ramdisk image on the CD.

Once the CD was booted, I pressed Alt-F2 to get to a console. Mounted my filesystem using
Code:

mount /dev/hda1 /target
- this is where the ramdisk shell tells you to mount stuff, logically...

Then used the nano-tiny editor on the ramdisk system to edit /target/etc/passwd. Changed zsh to bash on the lines for root and my regular user. Rebooted without the CD and problem solved.

Now I know what /etc/passwd does and a few other things - a worthwhile (if slightly frustrating) learning experience

Cheers
Francis


All times are GMT -5. The time now is 02:38 PM.