chmod 777 a directory only for a user not for all
I want to let user x to have all rights (delete, create, append, etc) on a directory / folder. But I want only that user to have R+W rights to that directory, and therefor I can't do chmod 777 to that directory, 'cause there are other users that needs to have only read access to that directory / folder. I'm using vsftp server and I'm letting the users to connect with the totalcomander client.
|
Like... I'll create:
user1 user2 user3 I want user1 to be able to read, delete and write in that folder / directory. I want user2 to have only read access and write access to the same folder / directory. I want user3 to have only read access to the same folder / directory. How do I do this ? I want to do this NOT with samba, I want to do this with the ftp (vsftp). |
Okay, so add that one user to the group that owns the shared folder (assuming it is not root owned). then set permissions:
rw,rw,r |
Quote:
|
You can do this by using ACL's..
just type the following commands for user<x> setfacl -d -m u:user1:rwx <directory-path> setfacl -d -m u:user2:rw <directory-path> setfacl -d -m u:user3:r <directory-path> It will give rwx to user1, rw to user2 only r to user3 for that particular directory. |
Ok, and the chmod for that directory ? What it should be ? 644 ?
Because at the moment it's 777, I needed to chmod 777 so that the user can write at that moment so now I need to change back. But, change back to what ? 644 ? http://www.javascriptkit.com/script/...chmodcal.shtml the chmod calculator :) |
Yes ytd, you can change back the permission to 644 or whatever default permission you would like to give it to your directory. This permission will be applicable to all the users "other" than what is set by the setfacl command.
Cheers!!! |
[root@xxx ~]# setfacl -d -m u:myuser:rwx /home/users/work/
setfacl: /home/users/work/: Operation not supported [root@xxx ~]# [root@xxx ~]# Obs: "myuser" does exist and the path too [root@xxx ~]# setfacl --help setfacl 2.2.23 -- set file access control lists Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ... -m, --modify=acl modify the current ACL(s) of file(s) -M, --modify-file=file read ACL entries to modify from file -x, --remove=acl remove entries from the ACL(s) of file(s) -X, --remove-file=file read ACL entries to remove from file -b, --remove-all remove all extended ACL entries -k, --remove-default remove the default ACL --set=acl set the ACL of file(s), replacing the current ACL --set-file=file read ACL entries to set from file --mask do recalculate the effective rights mask -n, --no-mask don't recalculate the effective rights mask -d, --default operations apply to the default ACL -R, --recursive recurse into subdirectories -L, --logical logical walk, follow symbolic links -P, --physical physical walk, do not follow symbolic links --restore=file restore ACLs (inverse of `getfacl -R') --test test mode (ACLs are not modified) --version print version and exit --help this help text [root@xxx ~]# [root@xxx ~]# uname -a Linux xxx 2.6.9-55.0.9.ELsmp #1 SMP Thu Sep 27 18:28:00 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux [root@xxx ~]# [root@xxx ~]# cat /etc/redhat-release CentOS release 4.5 (Final) [root@xxx ~]# |
http://serverfault.com/questions/110...-not-supported
But I don't want to do this, it says that facl is slowing down the system. Is that right ? "ACLs are disabled by default due to performance reasons. – grawity Feb 7 at 16:18" |
Quote:
And yes I must have told you earlier If your filesystem is ext2, ext3 you need to remount it by enabling the acl. http://articles.techrepublic.com.com...1-6091748.html http://www.wlug.org.nz/AccessControlLists |
aight, but what's the inconvenience ? Is it true that by enabling the acl in the filesystem, will slow down the SO, or something liek that ?
|
Dear ytd,
I could find no references which states that enabling up acl to your file-system slows it down. If you come across any such point in documentation then please share it so that u receive better help. |
Quote:
Please use the entry as similar to below in /etc/fstab Code:
LABEL=/home /home ext3 defaults,acl 1 2 Code:
mount -o remount /home |
Quote:
|
Just to point out that acls are set 'on' on the partitions that exist during the install of RHEL5, BUT if you create a new partition from scratch after installation, acls will not be automatically set on. Use the tune2fs cmd or the options in /etc/stab to do that.
|
All times are GMT -5. The time now is 10:19 AM. |