To add, delete, and grant sudo privileges to users on a FreeBSD server, you can use the adduser
, pw
, and visudo
commands.
Here are the steps to follow to add, delete, and grant sudo privileges to users on a FreeBSD server:
adduser
command. For example, to add a user named "john" with a home directory at /home/john
, you can use the following command:adduser
Follow the prompts to set the user's password and other details.
pw
command with the userdel
option. For example, to delete the user "john", you can use the following command:pw userdel john
/usr/local/etc/sudoers
file using the visudo
command. For example, to grant sudo privileges to the user "john", you can add the following line to the sudoers
file:john ALL=(ALL) ALL
This will allow the user "john" to run any command with sudo privileges.
Note: The
adduser
,pw
, andvisudo
commands have many options and features available for managing users and sudo privileges on a FreeBSD server. Consult the documentation and online resources for more information on the various options and features available with these commands. It is recommended to use these commands with caution, as improper use can cause security issues or disrupt the operation of the server.