You can add a user the Debian way with:
adduser
Or the traditional way with:
useradd
If your providing virtual web or mail hosting services then it's often a good idea to setup a UNIX user for each domain you host. This enables you to isolate domains at the file system permission level, providing an extra layer of security.
For example you can use suPHP with Apache to run each site's PHP scripts as a different user, and you can setup PureFTP to create files with the appropriate ownership (and permissions) when they are uploaded. Postfix's virtual delivery agent can also SETUID when delivering mail to maildir format mailboxes. It also makes it easier to implement file system level quotas.
In the example below we create a user with a home directory at /var/www/example.com and shell access disabled. The user is automatically assigned the next available UID starting from 2000.
I haven't yet figured out how to avoid the prompts for the GEKOS details when adding users the Debian way. Suggestions would be welcome on this point. Thanks.
Subscribe to the RSS feed for Andy's Debian HOWTOs
Article from Andy's Debian HOWTOs (http://www.besy.co.uk/debian/debian)
Discussion