Adding a User Account from the Command Line
This Howto describes the procedure for adding a user account outside of the ClearOS LDAP system (i.e. in /etc/passwd). The two most common reasons for this requirement:
- You need an account for running a third party service (daemon)
- You just want to have an old school user account outside of LDAP
Adding a System Account
If you are installing a third party service (daemon) on your ClearOS system, it is common practice to run the service under a unique account. Fortunately, most Linux distributions reserve a range of user IDs for this purpose. Unfortunately, this range differs across Linux distributions. In ClearOS, user IDs from 1 to 499 are reserved for system accounts. By specifying the -r flag in useradd, the account will automatically be created as a system account. For example:
useradd -r zimbra
You may also want to specify a different home directory with these accounts:
useradd -r -d /var/lib/zimbra zimbra
useradd: unknown GID 100
Adding an Old School User Account
In some circumstances, you may want to add an old school user account that will not overlap with LDAP. This is common practice in a ClearOS developer environment, especially if you are developing for the LDAP system! Fortunately, a range of user IDs have been reserved for this purpose. In ClearOS, user IDs from 500 to 999 can be used for an old school user account. By specifying the user ID with the -u flag, you can create an account in this old school range:
useradd -u 500 oldschool
After creating the account, you can set the password with:
passwd oldschool