25 October 2018

changing shells

i don't know if this a fedora-specific thing or a newer linux thing, but in the past changing your default shell was as simple as editing the /etc/passwd file. today, there is the chsh which can perform this for you. there is a catch, however. the shell must exist in the /etc/shells file to be allowed to be changed.

to make this work, i needed to add my shell to the /etc/shells file. then i issued the chsh to make my shell change.

$ chsh -l

$ sudo chsh -s /usr/bin/xonsh mock
Changing shell for mock.
Shell changed.

my previous post about xonsh is what led me here. i had manually changed the shell directly in the /etc/passwd file, but then my gnome session did not recognize my user. this was the strange side effect of changing the default shell not on the /etc/shells list. gnome (gdm) started the gnome-initial-setup process which runs when gnome is freshly installed.

and thing are still messed up. the gnome settings > users section shows no one, even though i am logged in under my account. (figuring out how to fix this will be another lesson for a future time.)