[英]Give same access to folders/files for multiple users
I need to manage multiple ssh users for different Heroku accounts, explained here . 我需要为不同的Heroku帐户管理多个ssh用户,如此处所述 。 I've created different users and logging in to Heroku with those works fine. 我已经创建了不同的用户,并使用这些用户正常登录到Heroku。 These are the users I have: 这些是我的用户:
computer_owner (admin rights)
user1 (admin rights)
user2 (admin rights)
But I want user1
and user2
to share the same files and folders as computer_owner
, ie all folders/files. 但是我希望user1
和user2
与computer_owner
共享相同的文件和文件夹,即所有文件夹/文件。 Is this possible and if so, how do I do this? 这可能吗,如果可以,我该怎么做?
OS X is a UNIX compliant operating system. OS X是UNIX兼容操作系统。 If you set the rights on files and folders correctly, you can provide access to all of the users. 如果正确设置了文件和文件夹的权限,则可以为所有用户提供访问权限。 There's a tutorial here on how to manage the access rights and many more around if you search for something like "Unix Permissions" 如果您搜索“ Unix Permissions”之类的内容, 这里有一个有关如何管理访问权限的教程。
Ideally, create a separate group using dscl and add the required members. 理想情况下,使用dscl创建一个单独的组并添加所需的成员。 Next, set the files to be owned by that group and each will have access to those files 接下来,将文件设置为该组的所有者,每个文件都将有权访问这些文件
So, an example would be something like this: - 因此,示例将是这样的:-
# create the group
sudo dscl . create /Groups/heroku_ssh
# add members
sudo dscl . append /Groups/heroku_ssh GroupMembership computer_owner
sudo dscl . append /Groups/heroku_ssh GroupMembership user1
sudo dscl . append /Groups/heroku_ssh GroupMembership user2
Assuming a directory called testDirectory: - 假设一个名为testDirectory的目录:-
# set full permissions for the owner and group
# 770 is read, write and execute for owner and group
sudo chmod -R 770 testDirectory
# set ownership of a file
sudo chown -R computer_owner:heroku_ssh testDirectory
This sets the owner to be the user computer_owner and the group heroku_ssh, so the owner and any member in the group can access the files in testDirectory 这将所有者设置为用户computer_owner和组heroku_ssh,因此所有者和组中的任何成员都可以访问testDirectory中的文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.