GNU/Linux Modifying Users

From WikiOD

Parameters[edit | edit source]

Parameter Details
username The name of the user. Do not use capital letters, do not use dots, do not end it in dash, it must not include colons, no special characters. Cannot start with a number.

Remarks[edit | edit source]

  • You cannot remove a logged in user
  • To modify any user but your own, you need root privileges

Setting your own password[edit | edit source]

passwd

Setting another user's password[edit | edit source]

Run the following as root:

passwd username

Adding a user[edit | edit source]

Run the following as root:

useradd username

Removing a user[edit | edit source]

Run the following as root:

userdel username

Removing a user and its home folder[edit | edit source]

Run the following as root:

userdel -r username

Listing groups the current user is in[edit | edit source]

groups

More detailed information about user and group numerical IDs can be found with the id command.

Listing groups a user is in[edit | edit source]

groups username

More detailed information about user and group numerical IDs can be found with id username.

Credit:Stack_Overflow_Documentation