Suppose that you are a superuser on a Linux system, and there is a file “/home/bob/foo”, which is owned by an ordinary user Bob. You need to give a permission to read this file to an ordinary user Alice, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice.
As given, In Linux system there is a file “/home/bob/foo”, which is owned by an ordinary user Bob. We need to give read permissions to Alice also, but not anyone else. To solve this, first, we need to create a group and need to add users Bob and Alice. Then we need to change the file permissions so that the newly created group can read that file.
groupadd GROUP1
usermod -a -G GROUP1 Alice
chgrp Alice /home/bob/foo
chmod 400 /home/bob/foo
As we have changed group ownership also, Bob can not access this file.
Get Answers For Free
Most questions answered within 1 hours.