1

i have ubuntu 10.04 on my sytem, i run command apt-get install csh on the system and try to change the shell by command chsh -s but now the prob is when i try to login the system by ssh i am not able to login by any user account except one and try to change the user su - root it is showing cannot execute c: no such file or directory and look in the /etc/passwd file for root account in shell field C is written in place of /bin/sh help me out to restore the settings

1 Answer 1

2

Boot live media.

Make sure your local HD is mounted by browsing for it in nautilus.

Open a terminal: CTL + ALT + T

Get root and change it to whatever shell you want:

sudo su
cd /media/partitionname/etc/
nano passwd

navigate to the root line which you say looks like this:

root:x:0:0:root:/root:C  

make it look like this to restore default:

root:x:0:0:root:/root:/bin/bash  

Press CTL+X then Y then Enter
It should save. Now type:

cd /
sync
exit
exit

Unmount the drive with the eject button in the nautilus window and reboot.

Easy peasy.

Now that it's correct you're able to log in as long as you don't run chsh -s c again. If you want to change a user's shell you specify the full path to the shell as expressed in /etc/shells like chsh -s /bin/csh NOT this chsh -s c

5
  • thankx aking1012, can u tell me please why the passwd file changes when i run the command chsh -s c. i m new to ubuntu. thanks again.. Mar 18, 2012 at 5:27
  • I think you made a typo. chsh is change shell. csh is a shell. Mar 18, 2012 at 5:32
  • why i m not able to login by any user root etc.. Mar 18, 2012 at 11:44
  • >>there is only one user account by which i can login.when trying to switch user #su - root it ask for password when i write password it is showing cannot extcute c: no such file or directory. Mar 19, 2012 at 11:07
  • hi aking1012..>> i was able to login to the system in resue mode and made the changes now my box is working fine..:):) Mar 21, 2012 at 10:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .