Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the group ownership of a file in Ubuntu? [closed]

I have a little question on how to change the group owner of a file. At the moment the group of the file is the same as my user name but I want to change it so another user can access that same file and read/write to it.

like image 304
PuchuKing33 Avatar asked Feb 18 '14 21:02

PuchuKing33


1 Answers

The syntax would be

chown user:group file ...

This usually (=when you're not root) only works as long as you are a member of the same group (since otherwise by chown'ing files you could exceed the other user's disk quota).

If you both are in the same group you could also allow write access with

chmod g+w file

As above this will allow all members of group write access.

If you do not share a common group, all you can safely do is to allow read access to the file so the other user can make a copy of it and edit his/her copy.

like image 103
Jens Avatar answered Feb 17 '23 01:02

Jens