I have two users, user1 and user2. I also have a file in
/path/to/file. user1 should be able to have read-write access, while user2 should only have read access.
I know that I can change permissions with
chmod u=r /path/to/file to read-only, however this changes the permissions for everyone? When executing the command as user1 the access changes for user1 and user2 as well. I haven't found a option to specify a user. Is this something where I'd have to use the groups? Or
chown? How would I go about doing this?
Is this also possible to do for a whole directory full of files? If there is a dir
/path/to/dir that contains n files and m subdirs, to change the permissions of every file and every file in the subdirs?