First and foremost, adduser can only be used by the root user. What this command does is add a new user to a system. It's fairly straight-forward and simple. Once you have root privileges (which can be either through su or sudo) at a bash prompt (using a terminal such as aterm, gnome-terminal, or konsole) the adduser command looks like this:
adduser [options] USERNAME
Where USERNAME is the actual name the user will log in with.
There are a number of options to be used with this command. The more important options are:
- d - This argument creates the home directory for the new user. You should define the new users home directory as their log in name. So if you use maryjane as your user login, the home directory will be /home/maryjane and the command would look like useradd maryjane -d /home/maryjane.
- m - If you have already created a user but failed to add a home directory, you can issue this argument with useradd (followed by the username) to create a home directory for the user.
- p - This will allow you to define the users password. The p argument is always followed by the actual password for the user. So, to add on to the above command, adding the user maryjane with a home directory of /home/maryjane and a password of 1mary2jane3, you would issue the command useradd maryjane -d /home/maryjane -p 1mary2jane3.