up vote 1 down vote favorite
share [g+] share [fb]

I have mistakenly setting my user login shell to some unknown directory:([1]. Now, I can't login to this user. Every time I try to ssh, it always failed as if I enter the wrong password. I try to login using root and do su --shell=/bin/tcsh username and I got

su: /path/to/shell/i/set/previously: permission denied

To be clear, /path/to/shell/i/set/previously point to some directory, not to shell executable. I've tried to change my login shell on /etc/passwd back to /bin/tcsh with no luck:(. Always got the same permission denied error:(.

Now, I wonder what chsh did that make me unable to login even after I change the entry on /etc/passwd. Also, how do I get back my previous shell (/bin/tcsh)

Thank you.

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

Login as root and use:

chpass username

You'll be in a vi buffer with the user settings. Change the shell to /bin/tcsh and Bob's your uncle.

As for why, these settings are actually held in /etc/master.passwd. /etc/passwd is generated from that file. Read The Fine Manual for more.

link|improve this answer
Unknown command “chpass” ... and how do you do this if the root user is the one you changed? – endolith Nov 21 '09 at 8:26
@endolith Are you using freebsd? – Richard Hoskins Nov 21 '09 at 12:38
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.