简体   繁体   中英

How allow folder permission for another user in Linux

Consider two user accounts user1 and user2 on one Linux machine. I want user2 to be able to have read and write access to a folder in user1 home directory.

So far created a group for both users and added both users

groupadd twousers
usermod -a -G twousers user1
usermod -a -G twousers user2

then changed the group and the path and changed the permission

chgrp twousers /home/user1/folder
chmod g+rwx /home/user1/folder

Unfortunately user2 is still unable to access the folder /home/user1/folder . It seems to be quite simple but somehow I am lost. What am I missing?

chown user1.twousers /home/user1/folder

chmod 775 /home/user1/folder

请尝试以下操作,直到获得许可,并确保您不弄乱文件或文件夹的路径或名称:

chmod u+rwX,g+rwX,o+rwX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM