Here’s how you can add, delete, and grant sudo privileges to users on a FreeBSD server:
- Add a new user:
pw useradd [username]
- Delete a user:
pw userdel [username]
- Grant sudo privileges to a user:
pw usermod [username] -G wheel
Note: The pw
command is used to manage users and groups in FreeBSD. The useradd
subcommand creates a new user, userdel
deletes a user, and usermod
modifies a user account. By default, only users in the wheel
group have sudo privileges in FreeBSD. Adding a user to the wheel
group grants them the ability to use sudo
.