0

I have a share directory with another user, say Bill. The directory has permission as 775. I create my own file with the same permission in the directory. My file has owner and group as my user account. If I log in as user Bill, and use vim, I see read-only warning. However, if Bill write to the file, he still can save it. And now the file owner and group belong to user Bill.

This is not what I expected. How can I prevent Bill to edit my file, and only allow to read it?

pmh
  • 1

1 Answers1

0

File permissions and vim (ro) warnings are not the same thing.

If vim is giving you are ro warning on a file with 755 permissions, then, my guess is either the file is in use of was not saved.

See https://superuser.com/questions/218262/how-to-get-rid-of-the-warnings-when-opening-a-file-that-has-a-swp-file or give details of the vim error.

File permissions are detailed here https://help.ubuntu.com/community/FilePermissions

You probably want file permissions of 644 or 640

See also acl How do I set up a folder so that anything created in it inherits permissions?

Panther
  • 102,067