Debian: Removing read permissions to a single user

1

i'm trying to set permissions with chmod in Debian Squeeze.

Its there any way to remove read permission to a single specified user?

chmod u-r file

That seems to deny permissions from the user invokating the command only. Is there a way to specify a user or group?

jviotti

Posted 2012-11-15T23:47:24.217

Reputation: 157

Answers

1

Install acls, that's what you want, if you need to edit rights to specific users without messing up with lots of standard linux groups.

Use mount, to see if there is option acl at your mount points.

Or try running getfacl yourfile, if this works than you are already using acls and you can add rights to more than one specific user by setfacl.

Here you can find nice backround to acls: http://users.suse.com/~agruen/acl/linux-acls/online/

week

Posted 2012-11-15T23:47:24.217

Reputation: 3 128

After 5+ years, this link is dead. Archive: http://archive.is/el8gM

– adamczi – 2018-02-08T09:03:28.153

0

File level permisions will be tied to owner, group, and world. Unless you want to change the owner of the file (chown), you can't do anything user wise.

The u flag for chmod is actually the owner of the file. You can use g instead to change the group permissions, e.g. chmod g-r file

Alternatively, you can use the numeric mode to change permissions for owner, group, and world all at once.

Relatedly, if you want to only have certain users access the file, you may need to create a new group (groupadd) and then change the group on the file using chgrp.

ernie

Posted 2012-11-15T23:47:24.217

Reputation: 5 938