Running chsh does not change shell

User account modifications will not be saved if you have opened /etc/passwd (vim /etc/passwd) when you try to change the info.

Alternative: try with usermod (as zol):

$ usermod -s /bin/zsh 

or

$ sudo usermod -s /bin/zsh zol

If this doesn't work either, edit /etc/passwd by hand.

sudo vipw
# set zol's shell to /bin/zsh
:wq

Just ran into this. No matter what I did logging in and back out would not change my shell yet it was listed in /etc/shells and in /etc/passwd.

finally it dawned on me: Maybe I am logged in with another session?

So I did

# who

and it validated I did have indeed other open sessions from other machines:

dom  pts/0        Nov 6 13:53 (10.1.6.121)
dom  pts/1        Nov 5 12:30 (10.1.6.165)
dom  pts/2        Nov 4 12:33 (10.1.6.197)

I then did:

pkill -KILL -u dom

I was immediately logged out and after logging back in: Voila! Shell was changed

Tags:

Shell

Zsh

Users