SSH connection issue in Google Cloud Server - google-cloud-platform

I'm getting the below error while trying to connect with Browser-based SSH in Google cloud server
Connection Failed
An error occurred while communicating with the SSH server. Check the server and the network configuration.
I tried to install the free SSL on Google Cloud server by using this link: https://www.cloudbooklet.com/install-free-ssl-certificate-for-wordpress-on-google-cloud-click-to-deploy/
but after this command
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
I got some error, and from that point, SSH is also not working.

Related

how to connect elasticsear API through Cassandra

when i connect elastic search using curl -XGET "http://localhost:9200/" Command through elassandra .show connection refused error
from bin i am running Cassandra -e. here is no error in logs but still not able to access ES on localhost:9200
how to connect elastisearch api through elassandra

getting Unable to connect to the server: x509: certificate signed by unknown authority inside google cloud shell

When running commands inside google cloud shell, I'm receiving this error "Unable to connect to the server: x509: certificate signed by unknown authority" I've read that running gcloud container clusters get-credentials YOURCLUSTERHERE --zone YOURCLUSTERZONEHERE can solve this issue, but is this necessary when you are using an authorized google cloud shell session?
I run into this error when trying to run any kubectl command against my only cluster in the current project

Unable to login GCP Virtual Machine (Reason: failed to connect to backend)

My GPC Linux VM is working fine and one day naturally can't log in, even though it is still running,
I used the nomachine to login and got error "authentication failed, please try again."
when SSH:
Connection via Cloud Identity-Aware Proxy Failed
Code: 4003
Reason: failed to connect to backend
You may be able to connect without using the Cloud Identity-Aware Proxy.
I also try add:
#! /bin/bash
useradd -G sudo USERNAME
echo 'USERNAME:PASSWORD' | chpasswd
and
route add default gw <gateway ip> eth0
I created another virtual machine and its image, but after a day I couldn't connect
Ensure you have a firewall rule to allow Cloud Identity-Aware Proxy (IAP) to connect to port 22 on the instance. Full instructions can be found at [1].
[1] https://cloud.google.com/iap/docs/using-tcp-forwarding?authuser=0#create-firewall-rule
Cause:
When an instance does not have a public IP address, SSH in a Browser needs to forward the SSH connection through IAP. The error "failed to connect to backend" indicates that the IAP proxy service was unable to open a TCP connection to the instance.
This is most often due to the VPC firewall not having a rule which allows the proxy to connect to the instance. It coulld also be due to the OS firewall or other VM network connectivity issue.

Google Cloud SQL pPostgreSQL psql client connection

Followed instructions to created Google Cloud SQL instance with PostgreSQL db. I can examine it from glcoud command line with the instance name:
gcloud sql instances describe my-fancy-instance-name
I get back oodles of details!
When I created the SSL certs, it gave me the psql command to connect, which matches the instructions from the instructions given by Google documentation on how to connect via public IP (I left that enabled for now).
Now, with the discovered IP and port, which was also verified by the gcloud command, I try to call psql to connect:
psql "sslmode=verify-ca sslrootcert=server-ca.pem \
sslcert=client-cert.pem sslkey=client-key.pem \
hostaddr=my_INSTANCE_IP \
user=my_USER_NAME dbname=my_DB_NAME"
It takes a bit but it comes back and reports:
psql: could not connect to server: Operation timed out
Is the server running on host “nnn.ooo.ppp.qqq" and accepting
TCP/IP connections on port xxxxx?
and I verified the ip, but the port was NOT returned by the gcloud command...
Now, I have my SSL (.pem) files in ~/.postgress folder and added that path in my command as well, but no joy.
Any ideas why the psql can't connect (connection times out)? Especially since the gcloud command works?
The error message suggests that the CloudSQL instance is not exposed to the local host IP. As in the documentation step 7, you need to add your local psql client IP to the Authorized network. Can you confirm if you did that? If your local host IP is dynamic, then you have to regularly re-add the IP to Authorized network once your local IP changed.
Following the Google documentation you provided, I successfully connected to my Cloud Postgresql database from my local psql client.

GCP: Unable to connect to Datalab

I'm trying to connect to the datalab using the following command:
datalab connect <datalab name> --no-user-checking
it gives the following error message:
Connecting to <datalab name>.
This will create an SSH tunnel and may prompt you to create an rsa key pair. To manage these keys, see https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
Waiting for Datalab to be reachable at http://localhost:8081/
bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 8081
Could not request local forwarding.
Could someone please help me resolve the issue?
Thanks a lot.
This issue is usually generated when another Datalab or external process is running in the background by using the port 8081. You can kill the existing process or reset the machine where the tunnel to Datalab is running on.
In case you are using Cloud Shell, you can reset it by clicking the "Options" button next to the "Web Preview" button and clicking on Restart option. Afterwards, try to connect again the the Datalab instance:
datalab connect <datalab name> --port 8081