Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-26-2007, 11:33 PM   #1
LQ Newbie
Registered: May 2007
Distribution: MEPIS 6.0, Ubuntu 6.06, and Cygwin
Posts: 1

Rep: Reputation: 0
Fixing Shell for Root user

Since I have recently changed to the Fish Shell, I had used chsh to change it for my main user account. When I su'd later I realized I hadn't changed it here, so I did it again. However, I apparently typed in the wrong path (I guess I should have gone ahead and done cat /etc/shells again). Now whenever I try to su it simply says "No shell".

I know there is a file for this some where as I have come across it before but I cannot seem to find it. How can I change the default shell? I also am not in the sudoers file so I can't exactly use sudo (help appreciated there) but I believe I can access root by using Ctrl+Alt+F1 and logging in there.
Old 05-27-2007, 01:31 AM   #2
LQ Newbie
Registered: Mar 2007
Distribution: Ubuntu
Posts: 17

Rep: Reputation: 4
The file is /etc/passwd

If you can't manage to log in as root to modify it, try booting from a CD or DVD. Or if you dual-boot with Windoze, you can see your Linux partitions with a utility called Ext2 IFS.
Old 05-27-2007, 11:56 AM   #3
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
If su doesn't work, then logging in directly as root is unlikely to work either, since exec'ing the shell is the same in each case. The easiest solution is to reboot and add 'init=/bin/sh' to the boot command line. Edit /etc/passwd, then exec /sbin/init to continue the normal boot process.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Root user bash shell look like "bash-2.05b#" and /root empty y2pk001 Linux - Security 6 03-22-2007 08:33 PM
Shell Script to check root user? kushalkoolwal Programming 4 09-22-2005 12:15 AM
how to test if user is root or not in a shell script? dr_zayus69 Programming 3 08-17-2005 03:00 AM
allow sudo for www user to run root shell script cccc *BSD 12 07-23-2005 03:48 PM
Logging in as root user in the shell with suse 9.1 OverTheTop Linux - Newbie 1 07-15-2004 01:44 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:11 PM.

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