Exam EX200 All QuestionsBrowse all questions from this exam
Question 28

SIMULATION -

Configure /var/tmp/fstab Permission.

Copy the file /etc/fstab to /var/tmp/fstab. Configure var/tmp/fstab permissions as the following:

Owner of the file /var/tmp/fstab is Root, belongs to group root

File /var/tmp/fstab cannot be executed by any user

User natasha can read and write /var/tmp/fstab

User harry cannot read and write /var/tmp/fstab

All other users (present and future) can read var/tmp/fstab.

    Correct Answer:

    To configure the file permissions for /var/tmp/fstab as described, follow these steps: 1. Copy the /etc/fstab file to /var/tmp/fstab using the command cp /etc/fstab /var/tmp/fstab. 2. Change the file owner and group to root using the command chown root:root /var/tmp/fstab. 3. Set the file permissions so that no user can execute it and all users can read it, using the command chmod 644 /var/tmp/fstab. 4. Use ACLs to give natasha read and write permissions: setfacl -m u:natasha:rw- /var/tmp/fstab. 5. Use ACLs to ensure harry has no read or write permissions: setfacl -m u:harry:--- /var/tmp/fstab. After these steps, you can use getfacl /var/tmp/fstab to verify the permissions.

Discussion
jahute27

cp /etc/fstab /var/tmp/fstab chown root:root /var/tmp/fstab chmod 770 /var/tmp/fstab setfacl -m u:natasha:rw- /var/tmp/fstab setfacl -m u:harry:rw- /var/tmp/fstab setfacl -m o::r--,m:r /var/tmp/fstab getfacl /var/tmp/fstab

midhun_das

770 or 660 ?

14_aman

question says all other users can read [r=4 ]

maxam20

chmod 664 /var/tmp/fstab

kitkat

harry is not suppose to have rw permissions as per the question. setfacl -m u:harry:--- /var/tmp/fstab

mattd81

Wouldn't it be chmod 664 /var/tmp/fstab It says all other users should have read access but non should be able to execute??

riddie78

can not be executed by any user... execute is 1 so 1 is taken from every ugo natasha can read and write ...setfacl -m u:user:rw- /var/tmp/fstab harry cannot read and write ...setacl -m u:user:--- /var/tmp/fstab all other users can write (444)... I dont think this means other as in users,groups,others so setfacl 000 for harry ... if they can write they can read so 666??? idk

riddie78

sorry for confusion, and write is 222 for write only so read and write is 666

kenkct

sudo su cp /etc/fstab /var/tmp/fstab chown root:root /var/tmp/fstab chmod oug-x /var/tmp/fstab setfacl -m u:natasha:rw /var/tmp/fstab setfacl -m u:harry:-- /var/tmp/fstab chmod o+r /var/tmp/fstab getfacl /var/tmp/fstab (to verify)

xXxM__JxXx

i used chmod o-w to make sure that others has no write access.

strTe

The file is a member of the root group and belongs to root. So root(rw) have rw_r_ _ r _ _ It is not executable by anyone. natasha has read and write access. harry has no read or write access. All other users can read the file. cp /etc/fstab /var/tmp/fstab chown root:root /var/tmp/fstab (not requireed) chmod 644 /var/tmp/fstab(rw_r _ _r_ _) setfacl -m u:natasha:rw /var/tmp/fstab setfacl -m u:harry:--- /var/tmp/fstab getfacl /var/tmp/fstab