toor (the word "root" spelled backwards) is an alternative superuser account in Unix-like operating systems, particularly BSD and its variants. It has a user ID (UID) of 0, making it identical to the root account in terms of system privileges.
Purpose
In Unix, it is traditional to keep the root filesystem as small as possible, moving larger programs and data to other filesystems. This increases the likelihood that the system can be brought to a semi-usable state in the event of a partial system failure. The root account is often configured with a shell that is small, efficient, and dependable (such as /bin/sh or /bin/csh) but may be awkward for daily use. The toor account is intended as a solution: it is identical to root but can be configured to use a different, more featureful shell (e.g., bash). Alternatively, toor may be configured with the emergency shell, allowing root to use the featureful one.
Implementation
In a Unix-like system, each user has a user ID number, which the kernel uses to manage permissions. User ID #0 is reserved for the superuser. Users log in by username, not by ID number, and a user's choice of login shell is managed by name. This separation allows a given user ID to be associated with more than one username, each having its own shell. Thus, both "root" and "toor" can share UID 0 but use different shells.
Security Considerations
The presence of a toor account (or more than one account with UID 0) triggers a warning in many security auditing systems. This is useful, as an unintended second superuser account may indicate a system compromise. Some argue that even an intentional toor account is a security risk, as it provides a second point of attack for gaining superuser privileges. However, if passwords are chosen and guarded carefully, the risk increase is minimal.
NetBSD ships with a disabled toor account (no password set), meaning it cannot be used to log in by default. This is not a security risk in itself, though it may generate security warnings.
Historical Context
The toor account has existed in BSD systems since at least the 386BSD era. In FreeBSD, it was originally created when the bash shell was installed, but later became a default account. The Jargon File (also known as the New Hacker's Dictionary) defines toor as "The Bourne-Again Super-user" — a play on the Bourne-Again Shell (bash).