Chsh says zsh is not in /etc/shells but it is

Hi everyone,

I am using Manjaro in a Distrobox / podman container. It comes with bash as a default shell and I wanted to change my shell to zsh, so I installed the zsh package. Then I ran chsh -s /bin/zsh but it said: Your shell is missing in /etc/shells, change denied, no permission. This is not true though. There’s several zsh entries in /etc/shells which are also displayed correctly by chsh -l. However, I noticed that the real path of zsh (which zsh) is not included, only all the symlinks. Adding that path did not help though. What’s going on?

The podman container is based on docker.io/manjarolinux/base:20241208.

Full /etc/shells:

/bin/sh
/bin/bash
/bin/rbash
/usr/bin/rbash
/usr/bin/bash
/usr/bin/sh
/usr/bin/systemd-home-fallback-shell
/usr/bin/git-shell
/bin/zsh
/usr/bin/zsh
/usr/sbin/zsh

It could be a spurious warning because of… :point_down:

/usr/sbin is a symbolic link to /usr/bin. So following the link, zsh can indeed be found, but it is possible that your virtualization software trips over that. :thinking:

I don’t have that in my /etc/shells - nothing with /usr/sbin/...

2 Likes

Strictly speaking, the /bin entries should also no longer be there, given that /bin is a symlink to /usr/bin.

1 Like

Not surprising as /usr/sbin isn’t used in /etc/shells by default.

1 Like

Hm - did I do something wrong when merging .pacnew for this file?
Or was this (perhaps not yet) addressed?
I still have /bin/$SHELL entries for all three in there.

It’s inconsequential (for now) - I know.

1 Like

It has not been addressed yet upstream. The default /etc/shells does indeed contain those entries, but they’re not really needed.


Did you reboot after making the change?

1 Like

Yes, I restarted the container.

I should also point out that I tried chsh -s with all the paths in /etc/shells and none of them worked.

Does the container have zsh installed, or are you tapping into /usr on the host?

zsh was installed inside the container. The host does not have zsh installed (and it has an immutable filesystem).

1 Like

I ran chsh -s $(which zsh)

That led to the same error message for me. which zsh returns /usr/sbin/zsh, hence my original attempt to use that as the parameter for chsh.