############## Question & Answer Bank ################################
(1)Question 1.
Scenario : You need to setup groups for different departments in your company.
You also need to set up user accounts for the employees in thoes departments.
A server with users with joshua and alex in the sales group; dax and
bryan in the hr group; zak and ed in the web group, and manager in the sales
hr, and web groups.
Instructions: 1. Assigns Gid 700 - sales , 800 - web , hr - 999.
2. Assign uid 888 - alex, dax - 900.
#####################################################################
(1)ANS:- 1
1)create users & set the user id.
2)create groups & set the group id.
3)Add user in to the perticular group.
1)useradd -u 888 alex
2)passwd alex
3)useradd -u 900 dax
4)passwd dax
5)useradd joshua
6)passwd joshua
7)useradd bryan
8)passwd bryan
9)useradd zak
10) passwd zak
11)useradd ed
12)passwd ed
13)useradd manager
14)passwd manager
15)groupadd -g 700 sales
16)groupadd -g 800 web
17)groupadd -g 999 hr
18)gpasswd -M joshua,alex,manager sales
19)gpasswd -M dax,bryan,manager hr
20)gpasswd -M zak,ed,manager web
21)tail /etc/group
############## Question & Answer Bank ################################
Question 2.
Scenario : For each group you have created in above scenario also needs a shareddirectory by their names under /depts directory. This will allow users in each
department to share the files, but will prevent users in other department from altering, or even seeing thoes files.
A share directory for each department that allows only users in that
department to enter it or create, view and alter files within.
#####################################################################
(2)ANS:- 2
1)To create directory.
2)To change the group owenership.
3)To give the write permition for the group.
4)To assign the sticky bit.
5)Login by the user & check the permitions.
1)mkdir /depts
2)cd /depts/
3)mkdir sales
4)mkdir hr
5)mkdir web
6)chown -g sales /depts/sales/
7)chown sales /depts/web/
8)chgrp hr /depts/hr
9)chmod s+w sales
10)chmod s+w web
11)chmod s+w hr
12)chmod o+t /depts/
############## Question & Answer Bank ################################
Question 3.
Scenario : Some data needs to be accessible to several groups. Use ACLs to
accoplish this. Directories accessible by several groups and users.
Create directory in /opt called tech. Change the permissions such that
root is owner and hr is the group. Use ACLs to give full permissions for /opt/tech/ to the web group. Allow alex read/execute( but not write) permission on the
/opt/tech directory. Set a default ACL of read/write for alex on that directory.
Create some files in /opt/tech/ as several of the users and verify access. Does
alex or Joshua have access to files ? Does Managers ?
#######################################################################
(3)ANS:- 3
1)To create directory under /opt.
2)To create a partition & mount with acl.
3)To change group owenership.
4)To give the permition.
5)To login by users & check it.
1)mkdir /opt/tech
2)chmod 777 /opt/tech
3)cd /opt/tech
3)touch 11 22 33 44
4)fdisk /dev/sda9
5)partprobe /dev/sda
6)mount -o acl /dev/sda9 /opt/tech
7)chgrp hr /opt/tech
8)setfacl -m u:alex:rx /opt/tech
9)setfacl -m g:web:rwx /opt/tech
10)setfacl -m u:manager:rwx /opt/tech
11)getfacl /opt/tech/
############## Question & Answer Bank ################################
Question 4.
Scenario : You'll add a new swap partition using the fdisk utility of 100mb.
Remember to make the partition work with the appropriate file type, and then
format and activate it. Make sure it's properly included in /etc/fstab so this
partition is used the next time you boot Linux.
######################################################################
(4)ANS:- 4
1)To create partition.
2)To update the kernel.
3)To format the partition with swap file system.
4)To enable the swap.
1)fdisk /dev/sda
2)partprobe /dev/sda
3)mkswap /dev/sda10
4)swapon /dev/sda10
5)free
6)vim /etc/fstab
/dev/sda10 swap swap defaoult 0 0
7)mount -a
8)reboot
9)swapon -s --- To check.
############## Question & Answer Bank ################################
Question 5.
Scenario : Create a new partition using fdisk tool, format it, transfer the
files currently on your /data directory to that partition, and revise
/etc/fstab so the new partition is properly mounted the next time you boot Linux.
#####################################################################
(5)ANS:- 5
1)To cretae the partition.
2)update the kernel
3)Format the partition.
4)Create the directory.
5)write the entry in fstab file.
1)fdisk /dev/sda
2)partprobe /dev/sda
3)fdisk -l
4)mkfs.ext3 /dev/sda12
5)mkdir /data
6) chmod 777 /data/
7)vim /etc/fstab
/dev/sda12 /data ext3 defoults 0 0
8)reboot
9)mount --- to check.
############## Question & Answer Bank ################################
################## END #########################
By Laxman D. Kadam
Ph. No. 9967413230
email:-vikasjk3@gmail.com
No comments:
Post a Comment