In: Computer Science
Note: You do not have to provide specific commands, just a short description will suffice.
In order to achieve this problem, at first we can create a group; add the user Bob to that particular group and then change the ownership of that file to the specific user and later at the end, we can give the user 'Bob' particular read permissions so that he can read it and me as being a superuser has access to that file too.
Commands to be used:
So to achieve this, we first create a group by using the command:
addgroup NewGroup
Then we add Bob of that group
usermod -G NewGroup Bob
Then we change the file permissions to allow read access to the members of the NewGroup group.
chgrp Bob /home/alice/foo
chmod 400 /home/alice/foo
This file will remain owned by super user, but be readable by Bob and not by the other users.
Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.
If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.