This website is not maintained anymore. Please visit www.nerdgirl.dkinstead  
This page was last modified: July 27 2010 13:22:13   
Too Cool for Internet Explorer

Adding users

Anyone who has to have access to your server, must have an account on the system. That is easily done with the command adduser:

Bold text is commands an information provided by you. Bold text in square brackets is keys. E.g. [enter] means that you must hit the enter button on the keyboard.

adduser
Username: xxx
Full name: First Last
Uid (Leave empty for default):
Login group [xxx]: www
Login group is www. Invite xxx into other groups? []:
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/xxx]:
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password: secret password
Enter password again: secret password
Lock out the account after creation? [no]:
Username : xxx
Password : *****
Full Name : First Last
Uid : 1002
Class :
Groups : www
Home : /home/xxx
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (wwwadm) to the user database.
Add another user? (yes/no): no
Goodbye!

As you can see, the process of creating a new user, can be 90% hitting [enter]. The only information given by the user in the example above, is username, full name, group and password. Remember passwords don't show on screen as you type.

Security must be carefully considered when giving other people access. The things a user can do on your system depends mainly of which group the user belongs to. If you wan't to have a look at the groups on your system, use this command:

cat /etc/group
# $FreeBSD: src/etc/group,v 1.19.2.3 2002/06/30 17:57:17 des Exp $
#
wheel:*:0:root
daemon:*:1:daemon
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
staff:*:20:root
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
guest:*:31:root
bind:*:53:
uucp:*:66:
xten:*:67:xten
dialer:*:68:
network:*:69:
www:*:80:
teamspeak:*:1001:
nogroup:*:65533:
nobody:*:65534:

I didn't add all these groups. They are all created by the system or by programs.

If you wan't to learn more about managing groups, read this fine article from O'Reilly: Using Groups to Eliminate Root which tells you all about giving users the access they need restricted by the groups.