Invalid shell
m |
Ninereasons (Talk | contribs) (invalid vs non-standard) |
||
Line 1: | Line 1: | ||
− | + | An '''invalid [[shell]]''' is a path to a program in the account database's ''login shell path'' field 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 <code>root</code> 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 <code>root</code>, which can be done as easily as, for example, assigning <code>/usr/local/bin/bash</code> as the root user's login shell, and then deleting that port. Oops. | |
+ | |||
+ | 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 (<code>/etc/shells</code>). | ||
[[Category: Shells]] | [[Category: Shells]] |
Revision as of 14:43, 7 June 2006
An invalid shell is a path to a program in the account database's login shell path field 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.
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
).