Home

etcshells

etcshells refers to the /etc/shells file on Unix-like systems, a plain text listing of valid login shells. The file is used by login-related programs and system utilities to determine whether a requested shell is permitted for an account. If a user's chosen shell is not listed, attempts to switch to that shell can be rejected by the system.

Format and content: /etc/shells typically contains one absolute path to a shell per line. Lines may include

Management and best practices: Editing /etc/shells generally requires root privileges. To add support for a newly

Security implications: Maintaining an up-to-date /etc/shells helps enforce access policies by ensuring only approved shells are

See also: chsh, pam_shells, login, sshd.

comments
starting
with
the
hash
character
and
blank
lines.
Common
entries
include
paths
such
as
/bin/sh,
/bin/bash,
/bin/tcsh,
/bin/ksh,
/bin/zsh,
and
/usr/bin/fish,
though
the
exact
contents
depend
on
the
distribution
and
installed
shells.
The
primary
purpose
is
to
provide
a
centralized
reference
for
allowed
login
shells.
installed
shell,
its
binary
path
should
be
appended
to
the
file,
ensuring
the
shell
is
actually
installed
and
executable
at
that
location.
After
modifying
the
file,
administrators
should
verify
the
path
and,
if
necessary,
inform
users
that
the
new
shell
is
now
permitted
for
login
and
chsh
operations.
Conversely,
removing
an
entry
from
the
file
can
prevent
users
from
setting
or
using
that
shell
when
pam_shells
or
similar
mechanisms
are
active.
usable
for
logins.
It
is
one
layer
of
defense
in
account
hardening,
but
it
does
not
replace
broader
authentication,
authorization,
and
system
hardening
practices.