How to create and delete users in Linux || useradd || userdel

preview_player
Показать описание
#useradd #userdel #linux #linuxessentials

How to create a user using useradd command in Linux?
to create a new user use the useradd command. The syntax is:
#useradd username
The useradd command can be executed only with admin permissions. The details of all users are available in /etc/passwd file
The options available with useradd are:
-d: to create a home directory
-u : to add a UID of choice
-g: to assign user to an existing group
-G: to add user to supplementary group

The command to delete a user is userdel. Syntax:
#userdel username
Again this command can be executed only by the admin

how to use -d option with useradd
how to use -u option with useradd
how to use -g option with useradd
how to use -G option with useradd
how to use -f option with userdel
Рекомендации по теме
Комментарии
Автор

userdel -r Smith should work to delete the user Smith and all the associated files and directories.

umairnaseer
Автор

1.1001 will be the minimum UID
2. I think there is no single command
3.useradd Ricky -u 2222 -g U4

sarbodayajena
Автор

How to delete the username and again create with the same name as user name

kandhukurinithin
Автор

It isn't possible to delete or create multiple users at once with only 'useradd' or 'userdel'. You have to create loop for that.

MrEjo
Автор

How to remove a user from a group either primary or secondary..?

abinchacko