How to use useradd, userdel commands

Configurare noua (How To)

Situatie

Solutie

Linux is a multi-user system, meaning more than one person can use it simultaneously. useradd is used to create a new account, while the passwd command allows you to add a password. Only those with root privileges or sudo can run the useradd command.

When you use the useradd command, it performs some major changes:

  • Edits the /etc/passwd/etc/shadow/etc/group, and /etc/gshadow files for the newly created accounts.
  • Creates and populates a home directory for the user.
  • Sets file permissions and ownerships to the home directory.

Here’s the basic syntax:

useradd [option] username

To set the password:

passwd the_password_combination

For example, to add a new person named John, enter the following command simultaneously:

useradd John

passwd 123456789

To delete a user account, use the userdel command:

userdel username

Tip solutie

Permanent

Voteaza

(2 din 4 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?