1

I'm very new to GCP and cloud computing in general and also I don't come from a software engineering background, so please excuse me if my language is not completely accurate.

I was working on a project in a Google Compute Engine VM. Now, I wanted to see if a colleague could work on my project, but when he connected to the instance, as it was connected to his user, the instance was empty.

Is there any way to share the same files for different users? Should I create a shared user so we face the same files when connecting? I'm not finding which is the way to do it. Both of us have admin privileges, so that shouldn't be a problem. Any help would be appreciated

Edit: Just to be clear, my goal is that whenever me and/or my colleague connect to our GCE instance, we always share the same folders

3

Let's say your name is Juan and your collegue is Mary. Each of you login to Google Compute Engine using SSH, which means that your Google User Identity determines your home directory.

Your home directory will look like /home/juan, Mary's will look like /home/mary.

The solution is to create a new directory that both of you share access to and enable permissions to both of you.

Change juan and mary below for your actual usernames. The command who will tell you who you are.

  1. Create a new group called users (any name you want): sudo groupadd users
  2. Add yourself to this group: sudo usermod -a -G users juan
  3. Add Mary to this group: sudo usermod -a -G users mary
  4. Create a new shared directory (any path you want): sudo mkdir /home/shared
  5. Change the group ownership to users: sudo chgrp users /home/shared
  6. Give the group users read,write,execute permissions: sudo chmod 755 /home/shared

No each time you login change to the /home/shared directory and do your work there. If you forget, copy your new files or changed files to the /home/shared directory.

1
  • This is exactly what I was looking for! Thank you very much, John. I'm guessing by the commands that my question was more related to Linux than Google Compute Engine – Juan C Jul 23 '19 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.