This is an archive of past FreeBSD releases; it's part of the FreeBSD Documentation Archive.

Adding A User with Root Privileges

Chapter 2. Adding A User with Root Privileges

If you didn't create any users when you installed the system and are thus logged in as root, you should probably create a user now with

    # adduser
The first time you use adduser, it might ask for some defaults to save. You might want to make the default shell csh instead of sh, if it suggests sh as the default. Otherwise just press enter to accept each default. These defaults are saved in /etc/adduser.conf, an editable file.

Suppose you create a user jack with full name Jack Benimble. Give jack a password if security (even kids around who might pound on the keyboard) is an issue. When it asks you if you want to invite jack into other groups, type wheel

    Login group is ``jack''. Invite jack into other groups: wheel
This will make it possible to log in as jack and use the su command to become root. Then you won't get scolded any more for logging in as root.

You can quit adduser any time by typing Ctrl-C, and at the end you'll have a chance to approve your new user or simply type n for no. You might want to create a second new user (jill?) so that when you edit jack's login files, you'll have a hot spare in case something goes wrong.

Once you've done this, use exit to get back to a login prompt and log in as jack. In general, it's a good idea to do as much work as possible as an ordinary user who doesn't have the power—and risk—of root.

If you already created a user and you want the user to be able to su to root, you can log in as root and edit the file /etc/group, adding jack to the first line (the group wheel). But first you need to practice vi, the text editor--or use the simpler text editor, ee, installed on recent version of FreeBSD.

To delete a user, use the rmuser command.