Search results
Top results related to google cloud shell ssh
Top Answer
Answered Oct 22, 2016 · 1 votes
Problem solved!
I realised I hadn't passed the location of the service account's key file. Like so:
gcloud auth activate-service-account --key-file=service-account-key-file-
I did this by downloading the key from the credentials area, then reuploading it into the Google Cloud Shell command line (it has a nice code editor called 'Orion' that lets you view and edit each uploaded file).
I then followed from step 3 onwards here
I modified the code in step 4 to send the API to an object in a bucket in Google Cloud Storage, like so:
curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxauth-tokenxxxxxxxxxxxxxx" --data-binary @requestb.json https://language.googleapis.com/v1beta1/documents:analyzeEntities?key=${NL_API_KEY}-
The above '@requestb.json' is another text file I uploaded to Google Cloud Shell, which contained the following json information:
{ "document":{ "type":"PLAIN_TEXT", "gcsContentUri": "gs://<bucket-name>/<object-name>" }}-
And it worked!
My object was a .txt file containing a sampled BBC News article and returned this response:
{ "entities": [ { "name": "Mosul", "type": "LOCATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Mosul" }, "salience": 0.16690882, "mentions": [ { "text": { "content": "ir Mo", "beginOffset": -1 } }, { "text": { "content": "ar Mo", "beginOffset": -1 } }, { "text": { "content": "of Mo", "beginOffset": -1 } }, { "text": { "content": "to Mo", "beginOffset": -1 } } ] }, { "name": "US", "type": "LOCATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/United_States" }, "salience": 0.058336213, "mentions": [ { "text": { "content": "he", "beginOffset": -1 } }, { "text": { "content": "y,", "beginOffset": -1 } } ] }, { "name": "Iraqi", "type": "LOCATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Iraq" }, "salience": 0.0219927, "mentions": [ { "text": { "content": "An Ir", "beginOffset": -1 } }, { "text": { "content": "ng Ir", "beginOffset": -1 } }, { "text": { "content": "h, I", "beginOffset": -1 } } ] }, { "name": "Qusay Hamid Kadhem", "type": "PERSON", "metadata": {}, "salience": 0.01995722, "mentions": [ { "text": { "content": "r, Qusay Hamid Kad", "beginOffset": -1 } } ] }, { "name": "Qaraqosh", "type": "LOCATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Bakhdida" }, "salience": 0.018237775, "mentions": [ { "text": { "content": "of Qaraq", "beginOffset": -1 } }, { "text": { "content": ".\r\nQaraq", "beginOffset": -1 } } ] }, { "name": "AFP", "type": "ORGANIZATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Agence_France-Presse" }, "salience": 0.0049931784, "mentions": [ { "text": { "content": "ld ", "beginOffset": -1 } } ] }, { "name": "IS", "type": "ORGANIZATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Islamic_State_of_Iraq_and_the_Levant" }, } "salience": 0.0046183467, "mentions": [ { "text": { "content": "he", "beginOffset": -1 } }, { "text": { "content": "ut", "beginOffset": -1 } } ] }, { "name": "Reuters", "type": "ORGANIZATION", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Reuters" }, "salience": 0.0041254032, "mentions": [ { "text": { "content": ".\r\nReut", "beginOffset": -1 } } ] }, { "name": "Christian", "type": "PERSON", "metadata": { "wikipedia_url": "http://en.wikipedia.org/wiki/Christian" }, "salience": 0.0016911785, "mentions": [ { "text": { "content": "st Christ", "beginOffset": -1 } } ] } ], "language": "en"-
My plan is to now send multiple responses to Big Query and then Data Visualisation as per this great article
1/5
Top Answer
Answered Nov 05, 2019 · 3 votes
I observed the same issue. I refreshed the console page ( CTRL + F5 ) and I was able to see the 'Activate Cloud Shell' button again !!
However, if above does not resolves the issue, some tips:
From google docs Google Cloud Shell Limitations
Weekly usage: Cloud Shell also has weekly usage limits. If you reach your usage limit, you'll need to wait until the specified time (listed under Usage Quota, found under the three dots menu icon) before you can use Cloud Shell again.
Also, there are usage limits on this, check your email if you had violated any conditions on shell usage:
Warning: Violating the Terms of Service will result in Cloud Shell being disabled for your account. This constitutes activity that adversely impacts Google Cloud Platform services, other customers' or their end users' use of services, or the Google network used to provide these services. Coin mining and network scanning using Cloud Shell are strictly prohibited.
2/5
Top Answer
Answered Apr 23, 2024 · 57 votes
I experienced this issue when trying to set up Kubernetes for the first time on Google Cloud Platform.
I was running into the error below each time I tried to SSH into my instance from my terminal:
[email protected]: Permission denied (publickey)-
Here's how I solved it:
Open a terminal on your workstation and use the ssh-keygen command to generate a new key. Specify the -C flag to add a comment with your username.
ssh-keygen -t rsa -f ~/.ssh/[KEY_FILENAME] -C [USERNAME]-
In my case it was:
ssh-keygen -t rsa -f ~/.ssh/kubernetes-trial -C promisepreston-
Navigate into the .ssh directory:
cd ~/.ssh-
Restrict access to your private key so that only you can read it and nobody can write to it.
chmod 400 [KEY_FILENAME]-
In my case it was:
chmod 400 kubernetes-trial-
Double click on kubernetes-trial.pub to open it OR print it on the console using the cat command:
sudo cat kubernetes-trial.pub-
The public SSH key should be of this format:
ssh-rsa [KEY_VALUE] [USERNAME]-
OR
ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}-
In my case it was:
ssh-rsa AAAAB3MzaC1yc2EAAAADAQABAAABAQDdLjLb2b97m9NSK5Z8+j6U8awAwIx1Sbn9o4cEpYT2USYlFhJPRckgnmCQ+Eaim/sgL40V2v3Jwt6HVAY0L9bl84jmvox9QP4FOY7+LM02ZqfRB6LaEukM1tGdObVr+HBvhOwrxGCI06GFjnD3vVzW4jEsK75Y7MPzXd5YSpebGvU+7ZOuEcuSKp/R9dJcJn4kdXeaqor4gh8uTKQ43PGPTEvyoNlCWLkwSgy8khbo2BpoChLA7B53pVEhviMvVVIbmwpc6V2AIhRYY7ppR8oBzklLgh8CtTBPXtQRYiahLOIhds6ORf7wGNFI+A4sbBqwEL3J6av5fE1+zkUBhAHX promisepreston-
Copy its contents and paste in the SSH Section of your instance under the Metadata section Adding or removing instance-level public SSH keys
In a local terminal, navigate to the directory where you have the private SSH key file, use the ssh command along with your private SSH key file, the username, and the external IP address of the instance to connect. For example:
ssh -i private-key username@external-ip-of-the-virtual-instance-
In my case it was:
ssh -i kubernetes-trial [email protected]-
After you connect, run commands on your instance using this terminal. When you finish, disconnect from the instance by running the exit command.
Note:
- Ensure that you added the instance-level public SSH keysAdding or removing instance-level public SSH keys
- Ensure that you are not blocking project-wide public SSH keys from the Linux instanceAllowing or blocking project-wide public SSH keys from a Linux instance
- Ensure that OS Login is not enabledEnabling or disabling OS Login
Other Answers
Answered Apr 19, 2023 · 11 votes
You have to make sure that the same username you used to generate the key matches the one from your local cpu.
Step-by-steps:
1/ Generate the key (no paraphrase)
On local cpu: By default on linux $USER will give you your username (echo $USER), so you don't even need to specify it.
ssh-keygen -t rsa -f ~/.ssh/my_google_cloud_key -C $USER-
2/ Copy the key to Google Cloud metadata
cat /home/$USER/.ssh/my_google_cloud_key.pub-
Select and copy it in https://console.cloud.google.com/compute/metadata/sshKeys (add key, then save)
3/ Connect to your VM
Get the external IP of your instance at https://console.cloud.google.com/compute/instances
EXTERNAL_IP={{input your external ip}}ssh -i ~/.ssh/my_google_cloud_key $USER@$EXTERNAL_IP
Other Answers
Answered Aug 10, 2018 · 4 votes
Connecting with an SSH key to a Google Cloud Compute Engine instance is not limited to the users of the project the instance belongs to. You can generate an SSH key and as long as it’s added to the instance and the user exists on the OS, you should be able to SSH. You can connect with other usernames. Make sure that:
- ["You add the public key to the instance via the Google Cloud Console [1]",""]
- ["Your username exists on the OS of your instance",""]
- ["If you want to SSH as \"root\", change the configuration in your /etc/ssh/sshd_config file.",""]
3/5
Top Answer
Answered Mar 27, 2022 · 0 votes
Unless you have a connection at Google who can help or a Googler reads this, without paying for Cloud Support you're falling (presumably intentionally) between the cracks.
The feedback is likely tracked but, as you suspect, it's likely low priority. BTW, you can check your reports to Google Feedback. This should confirm that this one at least made it into the system.
4/5
Top Answer
Answered Apr 02, 2020 · 1 votes
There's nothing Stack Overflow community could do with your ban of using Google Cloud Shell. Reasons for such restriction you can find in notification (probably via email) from Google Cloud.
To solve this issue you should follow instructions received in the message from Google.
As you can find in the documentation Cloud Shell is a managed by Google interactive shell environment for Google Cloud Platform:
Cloud Shell provides command-line access to the virtual machine instance in a terminal window that opens in the Google Cloud Console.
also, at Configuring Cloud Shell:
Cloud Shell provisions 5 GB of free persistent disk storage mounted as your $HOME
directory. All files you store in your home directory, including installed software, scripts and user configuration files...
So, your files accessible only via Cloud Shell and you should contact Google Cloud Support to reach them.
5/5
cloud.google.com › reference › cloud-shellgcloud cloud-shell ssh | Google Cloud CLI Documentation
cloud.google.com › reference › cloud-shellgcloud cloud-shell ssh | Google Cloud CLI Documentation. Documentation Technology areas. close. AI solutions, generative AI, and ML. Application development. Application hosting.
- Connect to Linux VMs
Use SSH to connect to Linux VM instances external IP...
- Cloud Shell
Manage your Google Cloud resources with the flexibility of a...
- About SSH connections
You use the SSH button in the Google Cloud console to...
- Use Cloud Shell
In addition to accessing the Google Cloud CLI and other...
- Connect to Linux VMs
cloud.google.com › shell › docsUse Cloud Shell with the gcloud CLI | Google Cloud
cloud.google.com › shell › docsMay 9, 2024 · Establishing an interactive SSH session with Cloud Shell using gcloud cloud-shell ssh. Copy files between your local and Cloud Shell machine via scp. Mount your Cloud Shell directory to...
People also ask
What is Google Cloud shell?
- Cloud Shell provides command-line access to the virtual machine instance in a terminal window that opens in the Google Cloud console. In addition to accessing the Google Cloud CLI and other utilities from the command line, you can use the cloudshell command to launch tutorials, open the Cloud Shell Editor, and download files.
Use Cloud Shell | Google Cloud
cloud.google.com/shell/docs/using-cloud-shellHow do I create an interactive ssh session with cloud shell?
- Establishing an interactive SSH session with Cloud Shell using gcloud cloud-shell ssh. Copy files between your local and Cloud Shell machine via scp. Mount your Cloud Shell directory to your local file system via sshfs. For more detail, see the reference documentation for gcloud cloud-shell.
Use Cloud Shell with the gcloud CLI | Google Cloud
cloud.google.com/shell/docs/using-cloud-shell-with-gcloud-cliDoes GCloud work with cloud shell?
- Yes. From the gcloud CLI, run gcloud cloud-shell ssh. This will establish an interactive SSH session with Cloud Shell. Reference: For future readers, the CLI Cloud Shell Alpha version only works on Linux. For Windows (and Linux) I wrote a program that integrates your desktop with Cloud Shell and provides a lot of features.
Is it possible to use the Google Cloud Shell via a ssh?
stackoverflow.com/questions/41324702/is-it-possible-to-use-the-google-cloud-shell-via-a-sshHow do I use cloud shell?
- Just connect to Cloud Shell and go. Easily develop cloud-based applications with the tools provided by our Cloud Code extension, allowing you to develop and deploy your Kubernetes and Cloud Run applications, manage your clusters, and integrate Google Cloud APIs into your project, all directly from the Cloud Shell Editor .
Cloud Shell | Google Cloud
cloud.google.com/shell/stackoverflow.com › questions › 41324702Is it possible to use the Google Cloud Shell via a ssh?
stackoverflow.com › questions › 41324702From the gcloud CLI, run gcloud cloud-shell ssh. This will establish an interactive SSH session with Cloud Shell. Reference: gcloud cloud-shell ssh