aoitcloud

FreeBSD

Creating a new user on FreeBSD with adduser

FreeBSD's adduser walks you through account creation interactively - a different workflow from Linux's useradd and passwd. Here's how it works, step by step.

3 January 2025 4 min read

If your first FreeBSD VPS login is as root, one of the first sensible things to do is create yourself an ordinary user account and stop using root for day-to-day work. On Linux you’re probably used to running useradd followed by passwd as two separate steps. FreeBSD does this differently: it has a single interactive command, adduser, that walks you through everything in one go.

Running adduser

Log in as root (or a user with equivalent privileges) and run:

adduser

You’ll be asked a series of questions, one at a time. A typical session looks like this:

Username: andrew
Full name: Andrew Oliver
Uid (Leave empty for default):
Login group [andrew]:
Login group is andrew. Invite andrew into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: csh
Home directory [/home/andrew]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:

Each prompt has a sensible default shown in square brackets – press Enter to accept it, or type a value to override it. At the end, adduser shows you a summary and asks you to confirm before it actually creates the account:

Username   : andrew
Password   : *****
Full Name  : Andrew Oliver
Uid        : 1001
Class      :
Groups     : andrew wheel
Home       : /home/andrew
Home Mode  :
Shell      : /bin/csh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (andrew) to the user database.
Add another user? (yes/no): no
Goodbye!

Behind the scenes, adduser updates /etc/passwd and /etc/group, creates the home directory, and populates it with default configuration files copied from /usr/share/skel. That’s the equivalent of what useradd and passwd do together on Linux, minus having to remember two separate commands and their respective flags.

The wheel group and privileged access

Notice the “Invite into other groups” prompt in the example above, where we entered wheel. This is the FreeBSD equivalent of adding a user to the sudo or admin group on Linux. Membership of the wheel group is what FreeBSD uses to control who is allowed to become root via su.

This matters because of a detail that surprises a lot of people coming from Linux: FreeBSD does not include sudo in the base system. There’s no sudo binary out of the box. You have two options:

  • Install sudo from packages if you want the familiar sudo command workflow: pkg install sudo, then configure it via visudo as you would on Linux.
  • Use plain su if you’re happy switching to a full root shell when you need privileged access. As long as your user is in the wheel group, running su and entering the root password will get you there. No extra packages required.

Neither approach is more “correct” – sudo gives you finer-grained, per-command control and logging, while su plus wheel is the simpler, zero-dependency option that’s been baked into BSD systems for decades. On a small single-admin VPS, plenty of FreeBSD users are perfectly happy never installing sudo at all.

Adding an existing user to wheel afterwards

If you forgot to add your user to wheel during the adduser prompts, you don’t need to recreate the account. Use pw, FreeBSD’s low-level user and group management tool:

pw groupmod wheel -m andrew

That adds the existing user andrew to the wheel group without touching anything else about the account. Log out and back in for the group membership to take effect.

The takeaway

Where Linux splits account creation into useradd plus passwd plus manual group editing, FreeBSD’s adduser does it all in one interactive pass. Add your new user to wheel during that process if you want them to be able to gain root access, and then decide separately whether you want the convenience of sudo or the simplicity of plain su.

Get in touch

Drop our team a message today