0% found this document useful (0 votes)
19 views

Command

The document provides instructions for a series of tasks related to managing user accounts, groups, and file permissions in Linux. Some key tasks include: 1. Creating a group called "sport" and users "football", "tennis", etc and adding them as members of the sport group. 2. Changing user "tennis" primary group to sport. 3. Removing users from the sport group and renaming the group. 4. Configuring file permissions for a file called "marchas" and a directory called "hello", including setting default permissions. The tasks cover commands for managing users, groups and permissions such as useradd, groupmod, chmod, and umask.

Uploaded by

mentesnot aweke
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Command

The document provides instructions for a series of tasks related to managing user accounts, groups, and file permissions in Linux. Some key tasks include: 1. Creating a group called "sport" and users "football", "tennis", etc and adding them as members of the sport group. 2. Changing user "tennis" primary group to sport. 3. Removing users from the sport group and renaming the group. 4. Configuring file permissions for a file called "marchas" and a directory called "hello", including setting default permissions. The tasks cover commands for managing users, groups and permissions such as useradd, groupmod, chmod, and umask.

Uploaded by

mentesnot aweke
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

task 1: creat a group name sport

$ sudo addgroup sport

task 2: creat username tennis,football,handball,vollyball


$ sudo useradd football
$ sudo useradd tennis
$ sudo useradd handball
$ sudo useradd volleyball

task 3: write a command tennis,football,handball and volleyball are member of sport


group(supplementary group, secondary group)
$ sudo usermod -aG sport football
$ sudo usermod -aG sport tennis
$ sudo usermod -aG sport volleyball
$ sudo usermod -aG sport handball
-----------------------------------------------------------------------------------
---------------
task 3.3: write a command that change the primary group of tennis to sport
$ sudo usermod -g sport tennis
-----------------------------------------------------------------------------------
---------------
to check the group of the user
$ groups football
$ groups tennis
$ groups volleyball
$ groups handball

task 4: view group account information


$ cat /etc/group
$ tail /etc/group

task 5: remove tennise and handball from sport group


$ sudo gpasswd -d tennis sport
$ sudo gpasswd -d handball sport

task 6: write a command to give privilage for a member of primary group or a user

task 7: change the group name sport to BestSport


$ groupmod -n BestSport sport

task 8: delete BestSport group


$ groupdel BestSport

task 9: change the group id to 3537


$ sudo groupmod -g 3537

task 10: create an account may hold, setting its home directory to /home/mayhold &
the group as may This would have korn-shell assigned it
$ sudo usermod -d /home/mayhold -g may -S /bin/kush mayhold

task 11: write a command to give privilage a primary group user


$ sudo visudo ==> goto sudo ==> %sprot ALL=/usr/bin,ls/usr/bin/less,/usr/bin/apt

task 12: write a command to give privilage for a member of primary group or a user
$ sudo visudo ==> go to root username==> ALL=?userbin/top then control+s ==>
control+x
***********************************************************************************
*
***********************************************************************************
*
file access mode
task 13: view the current defualt permission setting and makesure the outpu in
symbolic form
$ umask -S

task 14: view the curren default permission setting and makesure the output in
octal format
$ umask

task 15: create a new file name marchas and confirm the defualt permission
$ sudo touch marchas
$ ls -l marchos

task 16: copy /bin/bash to march and confirm the file permission
$ cp /bin/bash marchas
$ ls -l marchas

task 17: change the defualt permission to u wx, g x, o =


$ chmod 310 marchos

task 18: add read permission to other and group to marchas


$ chmod 354 marchos

task 19: current march as u=wx, g=x, o=r if you are asked to remove wright
permission from owner
$: chmod u-w marchas

task 20: add back the change permission to owner to marchas


$ chmod u+w marchas

task 21: remove both change and execute permission from other
$ chmod o-wx

task 22: remove all permission from group and othe ser
$ chmod go= marchas

directory access mode


task 23: view the current default permission setting and makesure the output in
symbol form
$: umask -S

task 24: view the current default permission setting and makesure the output in
octal form
$: umask

task 25: create a new directory name hello and confirm the default permission
$ mkdir hello
??? $ ls -l ???

task 26: copy /bin/bash to hello and confirm the directory permission
$ cp /bin/bash hello

change the defalt permission to u=wx g=x o=--


$ umask 467
$ umask -S

task 27: add read permission to othe and group to hello


$ umask 423

task 28: current hello u=wx,g=w,o=xw if you are asked to remove change permission
from owner
$ umask 623
$ umask -S(in symbolic)
$ umask (in octal form)

task 29: add back the change permission to owner to hello


$ umask 423 hello

You might also like