LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2005, 07:37 AM   #1
fdac
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Rep: Reputation: 0
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
 
Old 04-28-2005, 09:26 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
Old 04-28-2005, 08:09 PM   #3
fdac
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
Old 04-29-2005, 09:32 AM   #4
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
Old 04-30-2005, 09:57 AM   #5
fdac
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check in a script whether the shell is login or non login? frankie_DJ Programming 7 10-21-2015 10:09 AM
Difference between normal shell and login shell Manish Linux - General 7 11-14-2012 08:30 AM
wrong login shell prevent root login cefs99 Linux - Security 4 05-31-2006 08:28 AM
Removing Text from a Shell String OrangeLefty Programming 2 04-18-2004 11:08 PM
Removing shell login prompt SkinnyPupp Linux - Newbie 5 01-02-2004 01:57 AM


All times are GMT -5. The time now is 02:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration