0

I need to manage multiple ssh users for different Heroku accounts, explained here. I've created different users and logging in to Heroku with those works fine. 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, i.e. all folders/files. Is this possible and if so, how do I do this?

Community
  • 1
  • 1
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232

1 Answers1

1

OS X is a UNIX compliant operating system. 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"

Ideally, create a separate group using dscl and add the required members. 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: -

# 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

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85