Shared Access for Home Directory in google cloud Shell
Asked Answered
N

1

1

I am currently using the Google Cloud Shell, and I wish to access the persistent disk of another user. (Not using local shell)

More info on topic of inquiry: https://medium.com/google-cloud/no-localhost-no-problem-using-google-cloud-shell-as-my-full-time-development-environment-22d5a1942439

Naphtha answered 29/8, 2019 at 18:6 Comment(1)
See my GitHub project for managing Cloud Shell instances. See my comment below under guillaume blaquiere's answer. github.com/jhanley-com/google-cloud-shell-cli-goTrass
A
2

Cloud Shell is a micro vm dedicated to you, free, and with a mounted personal disk.

EDITED: Thanks to @Johnhanley comment, you can access to the cloud shell file of someone else with this code provided. However, you need the credential of the target Cloud Shell env and it's not very secure and recommended.

However, you can mount a fuse directory. And the other user also. With fuse, you navigate in a bucket like in directory. But be carefull, Storage bucket is not a file system: performance and usage aren't the same. Moreover, Fuse don't guaranty the data integrity in case of simultaneous file use, especially writing concurrency. Use with precaution.

But you can have a common workspace if it's your requirement.

If you use Cloud Shell as dev environment, like a computer or a VM, the same best practice are to apply. The dev environment has to be considered as ephemeral (computer can have outage or be lost/stolen, People can leave a company and you no longer have access to their cloud shell), and thereby you have to save your sources frequently on safe space (Git repository, Cloud Storage with Fuse)

Asceticism answered 29/8, 2019 at 21:40 Comment(8)
I was trying to allow the frontend developer to edit the front-end code while someone else work on the back-end code, without having them use the same account.Naphtha
I guess another way is to make everyone make a commit, and then only one person clones the repo and deployNaphtha
You can access the Cloud Shell instance of another user. You will need credentials for the other user. I wrote a Go program that has a good set of abilities for interacting with Cloud Shell instances: login, start Cloud Shell, ssh, execute commands, copy files, etc. github.com/jhanley-com/google-cloud-shell-cli-goTrass
@johnhanley, do you recommend this? Without go program, is it possible to reach the disk with ssh (from my cloud shell)? Like mounting the disk.Asceticism
1/2: From a security standpoint, no. The reason is that the other person must either give your their Google Accounts login and password, or have my program create tokens, which are saved to a file. I do not know the answer about mounting a Cloud Shell disk as I have not tried that. There are programs that can simulate file systems over SSH, but I have not tested any.Trass
2/3: As you know, Cloud Shell is designed to be a temporary development system (and a well thought out one). However, I would never do any serious development in Cloud Shell. I need high performance, backups, source code control, etc. I do use Cloud Shell all the time for development testing.Trass
3/3) In my next article series on SQL Server 2017 on Linux in Google Cloud (DevFest this week), I show how to use Cloud Shell to make issuing Let's Encrypt SSL certificates a simple process. Cloud Shell definitely is one of the tools that I use every day. That is the reason that I wrote my Go program. To make file copies to and from Cloud Shell scriptable and enable remote execution from my desktop to Cloud Shell.Trass
Definitively agree. Perfect for picking online environnement, with high speed connexion and all the useful lib install (and for different language). My internet connection speed is ugly at home and for a git clone (and then compilation/execution) or docker push/pull, is really helpful!!Asceticism

© 2022 - 2024 — McMap. All rights reserved.