UserAdd

useradd(8) creates a user.


Installation

Linux and BSD distributions will either have useradd(8) pre-installed, or direct users to instead use adduser(8).


Usage

useradd USERNAME

There are different opinions regarding how explicit to be with user groups (i.e. the group named the same as a user with the user as the only member). Above, the group is created implicitly. Sometimes the user group is created first with groupadd(8) and set as an option.

groupadd example
useradd --gid example example

This is more useful when forcing a specific ID.

groupadd --gid 1234 example
useradd --uid 1234 --gid example example

UserMod

To modify an exising user, such as adding them to a new secondary group, use usermod(8).

usermod --append --groups wheel example

UserDel

To delete a user (along with all of their files), use userdel(8).

userdel --remove --selinux-user USERNAME


See also

useradd(8)

usermod(8)

userdel(8)


CategoryRicottone

UserAdd (last edited 2023-06-29 16:27:07 by DominicRicottone)