我的本地用户localUser有 directory /home/localUser。还有一个用户serviceUser运行一些服务,他需要完全访问我主目录中的一些文件夹。
我想创建组serviceGroup并在serviceUser那里添加。然后我想授予对home/localUser/workingFolder文件夹的完全访问权限。
怎么做?
假设一个用户将是 /home 为其创建的用户:
-- 该用户默认拥有所有权限,至于其他人创建用户,然后将其添加到原始用户的组
-- 然后确保GROUP有777权限
Run Code Online (Sandbox Code Playgroud)sudo groupadd serviceGroup ## Creates the needed group sudo useradd serviceUser ## Adds the service tech user account sudo usermod -a -G serviceGroup serviceUser ## Adds service Account to the service group sudo chmod -R 777 $serviceGroup ## grants full access to the serviceGroup members sudo chown -R localuser:serviceGroup /home/localuser ## owner stays localuser but anyone in the serviceGroup "group" has access to its full contents
| 归档时间: |
|
| 查看次数: |
6662 次 |
| 最近记录: |