LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Fixing Shell for Root user (http://www.linuxquestions.org/questions/linux-general-1/fixing-shell-for-root-user-556956/)

Jareka 05-26-2007 11:33 PM

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.

Whyte 05-27-2007 01:31 AM

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.

dawkcid 05-27-2007 11:56 AM

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.


All times are GMT -5. The time now is 12:10 PM.