How to add/remove users, change password, create, edit groups and create sudo user on Debian linux?

Liiska kuqor Dhammaan dadka isticmaala degaanka

cat /etc/passwd

Waxa kale oo aad isticmaali kartaa amarka soo socda si aad u daabacdo kaliya qayb username ee kor ku xusan ee /etc/passwd wax soo saarka.

cut -d: -f1 /etc/passwd

Beegyada uu kor ku xusan: -d: isticmaali colon sida delimeter ah, -F1 heli duurka ugu horeysay.

Waa in aad xidid for soo socda

su
Ku dar user cusub

adduser username

Ka saar user

userdel username

tusaha User u baahan tahay in si gooni gooni ah la tirtiro haddii loo baahdo

rm -r /home/username

edit username

usermod -l {new username} {old username}
Badalida Lambarka sirta ah

passwd username
Create group

groupadd groupname

Add user to group
usermod -a -G groupname username

List all groups current user belongs to

groups

List all groups specific user belong to

groups username

List all groups

cut -d: -f1 /etc/group
Create sudo user

usermod -aG sudo username

Test sudo user

sudo ls -la /root

The above only works for root/sudo user

You will require to input the user password for the 1st time

If sudo command does not work you will need to install sudo package

apt install sudo

Leave a Reply