add-shell
Add a shell to the valid shells list
SYNOPSIS
add-shell shell_path
PARAMETERS
shell_path
The absolute path to the shell executable (e.g., `/bin/zsh`).
DESCRIPTION
The `add-shell` command is a simple utility used to add a shell's path to the `/etc/shells` file. The `/etc/shells` file lists the valid login shells on the system. This file is consulted by various programs, such as `chsh` and `ftpdaemons`, to determine if a user-specified shell is permissible.
By adding a shell to `/etc/shells`, you allow users to set it as their login shell, and programs that check against the contents of `/etc/shells` will recognize it as valid. It is a very important security aspect to avoid arbitrary code execution.
The command performs minimal error checking so the user must be cautious and ensure the added line is a valid absolute path.
CAVEATS
The `add-shell` command requires root privileges to modify the `/etc/shells` file. Improperly adding shells or adding invalid paths can lead to security vulnerabilities or system instability. The command doesn't verify the validity of the provided shell path. It's crucial to ensure the path is correct and points to a working shell executable.
SECURITY CONSIDERATIONS
Only add shells that are known to be secure and trusted. Avoid adding shells from untrusted sources, as they could potentially be exploited to gain unauthorized access to the system. Ensure the shell is installed correctly and has the appropriate permissions.
FILE FORMAT
The `/etc/shells` file is a simple text file, with one shell path per line. The paths must be absolute. Comments can be added using the '#' character at the beginning of the line.
SEE ALSO
chsh(1), shells(5)