2 Adding A User with Root Privileges

If you did not 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(1) instead of sh(1), 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(1) command to become root. Then you will not get scolded any more for logging in as root.

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

Once you have done this, use exit to get back to a login prompt and log in as jack. In general, it is a good idea to do as much work as possible as an ordinary user who does not 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(1), the text editor--or use the simpler text editor, ee(1), installed on recent versions of FreeBSD.

To delete a user, use the rmuser command.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.

Hosting by: Hurra Communications Ltd.
Generated: 2007-01-26 17:58:40