$ brew install caskroom/cask/google-cloud-sdk
==> brew cask install caskroom/cask/google-cloud-sdk
==> Caveats
google-cloud-sdk is installed at /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk. Add your profile:
for bash users
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc'
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc'
for zsh users
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc'
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'
==> Satisfying dependencies
==> Downloading https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
######################################################################## 100.0%
==> No checksum defined for Cask google-cloud-sdk, skipping verification
==> Installing Cask google-cloud-sdk
==> Running installer script 'google-cloud-sdk/install.sh'
==> Welcome to the Google Cloud SDK!
==>
==>
==> Your current Cloud SDK version is: 195.0.0
==> Installing components from version: 195.0.0
==>
==> +----------------------------------------------------------------------------+
==> | These components will be installed. |
==> +-----------------------------------------------------+------------+---------+
==> | Name | Version | Size |
==> +-----------------------------------------------------+------------+---------+
==> | BigQuery Command Line Tool | 2.0.30 | < 1 MiB |
==> | BigQuery Command Line Tool (Platform Specific) | 2.0.26 | < 1 MiB |
==> | Cloud SDK Core Libraries (Platform Specific) | 2018.03.16 | < 1 MiB |
==> | Cloud Storage Command Line Tool | 4.29 | 3.4 MiB |
==> | Cloud Storage Command Line Tool (Platform Specific) | 4.27 | < 1 MiB |
==> | Default set of gcloud commands | | |
==> | gcloud cli dependencies | 2017.10.20 | 1.4 MiB |
==> +-----------------------------------------------------+------------+---------+
==>
==> For the latest full release notes, please visit:
==> https://cloud.google.com/sdk/release_notes
==>
==> #============================================================#
==> #= Creating update staging area =#
==> #==================
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> #
==> #= Installing: BigQuery Command Line Tool =#
==> #
==> =
==> ==
==> ==
==> ====
==> ==
==> ===
==> ==
==> ==
==> ==
==> ===
==> =
==> ===
==> =
==> ==
==> =
==> =
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> ==
==> =
==> =#
==> #= Installing: BigQuery Command Line Tool (Platform Spec... =#
==> #
==> ==============================
==> ==============================#
==> #= Installing: Cloud SDK Core Libraries (Platform Specific) =#
==> #
==> ==============================
==> ==============================#
==> #= Installing: Cloud Storage Command Line Tool =#
==> #
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> #
==> #= Installing: Cloud Storage Command Line Tool (Platform... =#
==> #
==> ==============================
==> ==============================#
==> #= Installing: Default set of gcloud commands =#
==> #============================================================#
==> #= Installing: gcloud cli dependencies =#
==> #
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> =
==> ==========
==> =========
==> ==
==> =
==> =====
==> ==#
==> #= Creating backup and activating new installation =#
==> #============================================================#
==>
==> Performing post processing steps...
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> .
==> done.
==>
==>
==> This will install all the core command line tools necessary for working with
==> the Google Cloud Platform.
==>
==> Update done!
==>
==> ==> Source [/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc] in your profile to enable shell command completion for gcloud.
==> ==> Source [/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc] in your profile to add the Google Cloud SDK command line tools to yo
==>
==> For more information on how to get started, please visit:
==> https://cloud.google.com/sdk/docs/quickstarts
==>
==>
==> Linking Binary 'bq' to '/usr/local/bin/bq'.
==> Linking Binary 'gcloud' to '/usr/local/bin/gcloud'.
==> Linking Binary 'git-credential-gcloud.sh' to '/usr/local/bin/git-credential-gcloud'.
==> Linking Binary 'gsutil' to '/usr/local/bin/gsutil'.
🍺 google-cloud-sdk was successfully installed!
Free Linux cloud shell for Gmail users – shell in the browser that works in all locations I’ve been so far
Posted by jpluimers on 2020/05/18
This is still so cool: [WayBack] Free Linux cloud shell for Gmail users … – Adrian Marius Popa – Google+:
Free Linux cloud shell for Gmail users
https://news.ycombinator.com/item?id=16247577
comments are more interesting
“If you want a free Linux box with a Public IP and SSH, I’d recommend spinning up an f1-micro VM. It’s part of the permanent free tier”
Even cooler is that you can use it both from a web browser and from your own console, more on that below.
Cloud Shell from the web
The above links:
- [WayBack] Free Linux cloud shell for Gmail users | Hacker News (the shell is a temporary instance to a random machine that after inactivity gets shelved, but your personal storage in the
home
directory is kept) - [WayBack] If you want a free Linux box with a Public IP and SSH, I’d recommend spinning up… | Hacker News this actually is your VM: a micro instance of which you can use one for free.
I still need to use the f1-micro VM instance (my cloud and self hosted stuff is in different locations), but the cloud shell has saved my butt for so many times by now that I lost count.
Basically the shell worked everywhere I tried, where stuff like shellinabox [WayBack], anyterm [WayBack] or [WayBack] ajaxterm/qweb [WayBack] fail.
Each time you logon, you will be connected to a VM, so it takes a few seconds while you see
If you have not used it for a while, then it takes a bit longer as some provisioning needs to take place which can take about a minute at slow times:
Provisioning your Google Cloud Shell machine… Since you haven’t used your Cloud Shell for a while, it may take some time to unarchive your disk.
After 60 minutes of inactivity, it will disconnect:
Like a regular ssh client, the [WayBack] Secure Shell – Chrome Web Store Terminal emulator and SSH client fails in many situations because a lot of places block outgoing traffic over other ports than http (TCP port 80) and https (TCP port 443).
More links:
- Shell access is at https://console.cloud.google.com/cloudshell/editor?supportedpurview=project&shellonly=true
- File and shell access is at https://console.cloud.google.com/cloudshell/editor?supportedpurview=project
Cloud Shell from the MacOS console
Shortly after the Google Cloud Shell announcement, access got extended beyond the web interface: [WayBack] Google Cloud Platform Blog: Introducing the ability to connect to Cloud Shell from any terminal.
That page only shows how you use console access to the Google Cloud Shell, not how to install it. So below are the installation instructions on a Mac with MacOS/Mac OS X/OS X.
Installing the console client for Google Cloud Shell access.
The easiest way to install the console client is by using homebrew
[WayBack] and running these commands (a detailed gist with output is at the end)
brew install caskroom/cask/google-cloud-sdk
gcloud alpha
gcloud alpha cloud-shell ssh
gcloud auth login
gcloud alpha cloud-shell ssh
Somehow this fails. See the log below.
Related links:
- [WayBack] homebrew-cask/google-cloud-sdk.rb at master · caskroom/homebrew-cask · GitHub
- [WayBack] Google Cloud Shell Documentation | Cloud Shell | Google Cloud
- [WayBack] gcloud alpha cloud-shell | Cloud SDK | Google Cloud
- [WayBack] gcloud alpha cloud-shell ssh | Cloud SDK | Google Cloud
- [WayBack] Google Cloud Platform Blog: Introducing the ability to connect to Cloud Shell from any terminal
- [WayBack] Quickstart for macOS | Cloud SDK Documentation | Google Cloud
- [WayBack] Persistent Disk – Persistent Local Storage | Google Cloud
- [WayBack] GitHub – libfuse/sshfs: A network filesystem client to connect to SSH servers
Via: [WayBack] Introducing the ability to connect to Cloud Shell from any terminal Introducing the ability to connect to Cloud Shell from any terminal… – Adrian Marius Popa – Google+
The Cloud Shell runs on an f1-micro VM instance
If you are contemplating about using an f1-micro VM instance, it pays to know that the Cloud Shell runs on one (see the “log” in the “about” below).
A few years ago, the OpsDash people did some analysis on what performance the f1-micro VM actually provides [WayBack] Exploring the Google Cloud f1-micro Instance – OpsDash did.
From the “about” the Cloud Shell shows that it consists of.
Google Cloud Shell
Free, pre-installed with the tools you need for the Google Cloud Platform. Learn More
–jeroen
$ gcloud alpha
You do not currently have this command group installed. Using it
requires the installation of components: [alpha]
Your current Cloud SDK version is: 195.0.0
Installing components from version: 195.0.0
┌──────────────────────────────────────────────┐
│ These components will be installed. │
├───────────────────────┬────────────┬─────────┤
│ Name │ Version │ Size │
├───────────────────────┼────────────┼─────────┤
│ gcloud Alpha Commands │ 2017.09.15 │ < 1 MiB │
└───────────────────────┴────────────┴─────────┘
For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notes
Do you want to continue (Y/n)? Y
╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gcloud Alpha Commands ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝
Performing post processing steps...done.
Update done!
Restarting command:
$ gcloud alpha
ERROR: (gcloud.alpha) Command name argument expected.
Usage: gcloud alpha [optional flags] <group | command>
group may be app | auth | billing | cloud-shell | compute | config |
container | dataflow | deployment-manager | emulators |
endpoints | firebase | functions | genomics | iot |
kms | ml | ml-engine | monitoring | organizations |
projects | pubsub | resource-manager | resources |
scheduler | services | source | spanner | tasks
command may be init | interactive | search-help
For detailed information on this command and its flags, run:
gcloud alpha --help
$ gcloud alpha cloud-shell ssh
ERROR: (gcloud.alpha.cloud-shell.ssh) You do not currently have an active account selected.
Please run:
$ gcloud auth login
to obtain new credentials, or if you have already logged in with a
different account:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
Console starting step:
$ gcloud auth login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&access_type=offline
WARNING: `gcloud auth login` no longer writes application default credentials.
If you need to use ADC, see:
gcloud auth application-default --help
Web steps:
- At success you end up at https://cloud.google.com/sdk/auth_success
Console finishing when the success page displayed:
You are now logged in as [jeroen.pluimers.com@gmail.com].
Your current project is [None]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
$ gcloud alpha cloud-shell ssh
WARNING: The public SSH key file for gcloud does not exist.
WARNING: The private SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/jeroenp/.ssh/google_compute_engine.
Your public key has been saved in /Users/jeroenp/.ssh/google_compute_engine.pub.
The key fingerprint is:
SHA256:
........................................... jeroenp@RMBPro1TBJWP.local
The key's randomart image is:
+---[RSA 2048]----+
...................
+----[SHA256]-----+
ERROR: (gcloud.alpha.cloud-shell.ssh) PERMISSION_DENIED: Cloud Shell API has not been used in project google.com:cloudsdktool before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudshell.googleapis.com/overview?project=google.com:cloudsdktool then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
- '@type': type.googleapis.com/google.rpc.Help
links:
- description: Google developers console API activation
url: https://console.developers.google.com/apis/api/cloudshell.googleapis.com/overview?project=google.com:cloudsdktool
The problem is that the URL returns a failure so it cannot be used to enable the API:
https://console.developers.google.com/apis/api/cloudshell.googleapis.com/overview?project=google.com:cloudsdktool -> The API "cloudshell.googleapis.com" doesn't exist or you don't have permission to access it
Leave a Reply