Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RAW commands to set Google Shell in Linux Shell
- Open a Linux terminal and press CTRL+T
- mkdir .gs
- cd .gs/
- curl -o sdk.sh sdk.cloud.google.com
- chmod +x *;./sdk.sh (enter the path of PWD)
- cd google-cloud-sdk/bin
- ./gcloud auth login --no-launch-browser
- ./gcloud cloud-shell ssh
- sudo nano /etc/bash.bashrc
- alias gshell='~/.gs/google-cloud-sdk/bin/gcloud cloud-shell ssh'
- gshell
- _________________Step By Step
- Setting Up Google Cloud Shell on Linux via Command Line
- 1. Create Directory for Google Shell:
- mkdir ~/.gs && cd ~/.gs
- 2. Download and Install Google Cloud SDK:
- curl -o sdk.sh sdk.cloud.google.com
- chmod +x sdk.sh && ./sdk.sh --install-dir=~/.gs
- 3. Authenticate with Google Cloud:
- cd <path>/google-cloud-sdk/bin
- ./gcloud auth login --no-launch-browser
- 4. Access Google Cloud Shell:
- ./gcloud cloud-shell ssh
- 5. Set Up Alias (Optional):
- sudo nano /etc/bash.bashrc
- alias gshell='~/.gs/google-cloud-sdk/bin/gcloud cloud-shell ssh'
- source /etc/bash.bashrc
- 6. Usage:
- gshell
- Additional Notes:
- - Update SDK:
- gcloud components update
- - Documentation: Google Cloud SDK Docs: https://cloud.google.com/sdk/docs
- ____________________________________________________________________________________
- # Set Unset Project ID in google-shell
- # Set your gshell project_ID
- gcloud config set project my-project-name
- # Verify
- gcloud config get-value project
- # Login with project_ID
- alias gshell='~/.gs/google-cloud-sdk/bin/gcloud cloud-shell ssh --project=my-project-name'
- # Unset project_id
- ./gcloud config unset core/project
- # Login script update
- alias gshell='~/.gs/google-cloud-sdk/bin/gcloud cloud-shell ssh'
- _____________________________________________________________________________________
- # share files from Local to cloud
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement