pavement

Invalid shell

From FreeBSDwiki
Revision as of 16:41, 7 June 2006 by Ninereasons (Talk | contribs)
Jump to: navigation, search

An invalid shell is a path in the account database's login shell path field to a file that does not exist, cannot be executed for login or, if executed does not provide a shell. /sbin/nologin is an invalid shell, and /bin/false is another, both of which are program paths that root can use to intentionally disable shell access for the user to which they are assigned as the login shell. It is a valid reason to be distressed if you somehow manage to unintentionally assign an invalid shell to root, which can be done as easily as, for example, assigning /usr/local/bin/bash as the root user's login shell, and then deleting that port. Oops. What if bash is not located on your boot partition, and /usr/local/bin fails to mount? Oops again.

This isn't quite the same thing as a non-standard shell - which can include any valid shell, the path of which is not listed in the shell database (/etc/shells). A non-root user cannot assign itself a shell that does not exist in the shell database; or, the message will return:

%chsh -s /sbin/nologin
chsh: /sbin/nologin: non-standard shell

Obviously, you don't want an invalid shell to be listed in the database of standard shells (/etc/shells).

Personal tools