Under Linux, can a certain folder be authorized to a certain user or a certain group separately? Other users or groups have no permissions on the folder, and the ownership of the folder remains unchanged?
For example,
has the folder test1
The permission is drwxr-xr-x and the owner is A
A wants B to have the same permissions on the folder, and other users do not have the same permissions. The owner of the folder is still A
How to do it from the command line? I'm a noob, thanks for the advice.
将组权限设置成和拥有者一样
将B加入A的组
如果想让两个用户拥有一样的权限你首先需要修改文件夹权限chmod 775 test1,然后再将B所在组改为A所在组或者将B加入A所在组,用法如下:
usermod -g group loginname
强行设置某个用户所在组
usermod -G groups loginname
把某个用户改为 group(s)
usermod -a -G groups loginname
把用户添加进入某个组(s)
用acl就可以了。
好像是这样子写
setfacl -m user:B:rwx test1
chown [用户名] [文件夹]