Register valid login shells
Add a shell to /etc/shells
sudo add-shell [/usr/local/bin/zsh]
Add multiple shells
sudo add-shell [/bin/fish] [/bin/zsh]
add-shell shell [shell...]
add-shell is a Debian utility that safely adds new shell paths to /etc/shells. The /etc/shells file lists valid login shells that users can select with chsh.
It copies /etc/shells to /etc/shells.tmp, appends any given shells that are not already present, then copies the temporary file back over /etc/shells. Skipping already-present entries makes it safe to call repeatedly from package maintainer scripts. Its counterpart remove-shell deletes entries.
shell
Absolute path to the shell executable to add
Requires root privileges. The shell executable must exist and be valid. Not available on all distributions; on systems without this command, manually edit /etc/shells.
add-shell is part of the Debian packaging utilities, created to provide safe manipulation of /etc/shells during package installation scripts.
apt: sudo apt install debianutils
aur: yay -S debianutils
zypper: sudo zypper install debianutils
brew: brew install debianutils
nix: nix profile install nixpkgs#debianutils
chsh(1)
[Source code](https://salsa.debian.org/debian/debianutils)
[Documentation](https://manpages.ubuntu.com/manpages/noble/man8/add-shell.8.html)