2

Using chsh in Catalina is annoying because during a system update /etc/shells is reverted back to the default content. I use Fish as my shell and I don't want to keep an eye on that file. Is there a way to set the default shell system-wide (so I don't have to touch my terminal emulator preferences) for a given user without using chsh? Something like Linux's usermod would be nice

3
  • What do you mean system wide? Chsh just changes the current user's shell – mmmmmm Sep 15 '20 at 10:53
  • Probably system-wide is not the right term, sorry. I'm looking for a way to tell all the apps that my user runs which is my shell – Tae Sep 16 '20 at 11:31
  • What do you think usermod does, that chsh does not? Also, why do you think an update will replace /etc/shells? I've had /usr/local/bin/ksh in mine for ages, Catalina just whines with a entry in Relocated Items but doesn't replace the file. – Marc Wilson Sep 16 '20 at 17:11
2

You should be able to use

sudo chsh -s /usr/local/bin/fish USERNAME

to change user USERNAME to a shell which isn't listed in /etc/shells.

PS: Might be worthwhile to create a second admin account first so you won't get locked out if the behaviour changes with future releases.

5
  • OK, apparently I was misled, now I'm reading the manual (sorry!), and looks like you can use any shell, even one that's not listed in /etc/shell, as long as you are an administrator? Does it depend on some group? – Tae Sep 16 '20 at 12:21
  • @Tae As an administrator (or with sudo) you can change the shell for any user, independent of whether that user is an administrator itself. – nohillside Sep 16 '20 at 13:13
  • I understand that. What confuses me is when the shell should be listed in /etc/shells? I thought it should be there always, but apparently that's not the case? – Tae Sep 16 '20 at 14:16
  • @Tae What we know for sure is that a binary needs to be listed in /etc/shells to allow non-admin users to use chsh for it. Also login via ftp will not work if the user shell is not listed there (maybe other logins will fail as well). – nohillside Sep 16 '20 at 15:26
  • Thanks for all your patience, it works as described – Tae Sep 17 '20 at 8:12

You must log in to answer this question.

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