1830241 Members
5066 Online
109999 Solutions
New Discussion

Re: file permission

 
juno2
Super Advisor

file permission

How can I set to allow a specific user to write sth to a file , ( but other users can't do that even they are in the same group) ?
Thx.
3 REPLIES 3
Stuart Browne
Honored Contributor

Re: file permission

Change the owner of the file to the user you want to write to it, and then set it so there's only u+w, i.e.

chown user file
chmod 644 file

This would state that all users can 'read' the file, but only 'user' can write to it.

The number is the bit-mask of the permissions. Simply put:

read = 4
write = 2
execute = 1

In the order of:

user
group
world

So for the first column, the 'user' column, they can 'read' and 'write', thus '4 + 2' = 6.

The second column, the 'group' column, can 'read', thus '4'.

There is a first bit of which goes infront of those, but it defaults to 0 if you don't specify it. Read 'man chmod' for more details on that, and other user-permissions.

(NOTE: This is only one way of setting permissions. There are many others. For instance, the command 'chmod u=rw,go=r file' would do the same as the above.)
One long-haired git at your service...
Balaji N
Honored Contributor

Re: file permission

hi,

can u check the man pages of acl for more info.

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Paul Sperry
Honored Contributor

Re: file permission

chacl ???user.group +w??? file