couldnot access ssh on port 22, while opening terminal using browser front-end - google-cloud-platform

I am accessing google cloud instance terminal using browser front-end, but it is not opening. It gets struck on transferring ssh keys and ends by giving the error "couldnot access ssh on port 22"

Check whether port 22 is open in the firewall for that specific instance. You can follow this document to manage your firewall rules. You can try connecting via serial console instead. The issue you are facing could arise due to many different reasons. It is worth trying different troubleshooting steps for SSH connectivity.

Related

install odoo14 on ubuntu 20 on AWS lightsail This site can’t be reached44.202.124.139 refused to connect

server from AWS lightsail
pinging reply
service is running
However I got this error
This site can’t be reached
44.202.124.139 refused to connect.
and port is allowed
Check your security groups if it allows port 8069 (and other ports you are using) by the inbound rules. Also, check if your Ubuntu's firewall is enabled. If it is then also configure it to allow those port(s). This should make it possible to connect to your server from the outside to the specific port.
If the problem still persists then I would think that it is not port-related and will try to look at other places for more clues.

EC2 Server Instance running RStudio on port 8787 Timing Out

I am attempting to run RStudio on an AWS EC2 instance, but it keeps timing out. I am currently following the instructions in this post (https://aws.amazon.com/blogs/big-data/running-r-on-aws/).
From my research, I realize that this is most often a security group issue.
My instance has access to SSH port 22 and Custom TCP port 8787. I've been troubleshooting using this link (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectionTimeout).
I have tried using both default VPC and my own, both of which have the following subnet network ACL rules.
However, my public IPVv4 DNS (http://ec2-18-234-130-212.compute-1.amazonaws.com/) keeps timing out. I cannot access the login page.
A friend who set up their instance using the first link was successful, and as far as I can tell, I have done everything the same.
Any help is greatly appreciated!
Your RStudio works fine. In your URL you have to provide port number: 8787
http://ec2-18-234-130-212.compute-1.amazonaws.com:8787
As you wrote in the question, it seems you are using the link without the port number.
p.s.
As you've setup it currently, your traffic to RStudio goes unencrypted over HTTP. If you are not fine with that, a quick fix would be to use ssh tunnel from the instance to your local workstation. With this can close port 8787 as all traffic goes over port 22 and ssh.
Do you access the login page in web browser? If you doing that, you forgot to open port 80/443

SSH browser doesn't work in Compute Engine GCP

When i click the SSH button in the Complete Engine page, the shell window pops up and it shows that the ssh keys are being migrated. After that dialog disappears, nothing happens. I get a blank page without any prompt.
If you're using Firefox (same as me). This seems to be the problem as chrome works fine. Apparently Firefox has a bug. Idk if it's an actual bug or it's done on purpose because sometimes (less times) this works on Firefox and then sometimes doesn't unless I keep and keep reopening an closing the SSH.
Instead of opening and closing every time hoping for a chance to work and or using chrome, If you have linux or in my case I have Windows subsystem for Linux on my windows computer, so I can just SSH to it.
For windows, you could use the subsystem, or use Putty (Here's a putty tutorial https://www.youtube.com/watch?v=fmh94mNQHQc on how to connect to GCC) That putty tutorial is also similar to how you can do it on the subsystem so you can still watch it for that too
It's a bug in a Chromium library that affects Firefox. Use Chrome as a workaround.
To use the browser to SSH to a GCE instance, you need to be a compute instance admin. Also, if you run that instance with a Service Account, your account need to be a Service Account user. Check this link for more information: https://cloud.google.com/compute/docs/ssh-in-browser
In addition, did you check that your firewall allows connections to SSH port (22) from Google IP ranges ?
You can find them by using these commands (see https://support.google.com/a/answer/60764)
nslookup -q=TXT _netblocks.google.com 8.8.8.8
nslookup -q=TXT _netblocks2.google.com 8.8.8.8
nslookup -q=TXT _netblocks3.google.com 8.8.8.8
You can try different methods of connecting an instance to see if the issue is underlying at SSH or somewhere else.
There are several ways to connect a Linux instance via the SSH. You can connect to an instance via the terminal. You can connect via the Cloud Console Web UI which is in general the most convenient way to connect to an instance. Also, you can use Google Cloud SDK and run below command to connect to an instance via SSH:
$ gcloud compute ssh [INSTANCE_NAME]
You can also use Cloud Shell to connect your instance from the Cloud Console web UI by using the same command as above. You can connect via the serial console using the Google Cloud Platform Console, the gcloud command-line tool, or a third-party SSH client. The serial console authenticates users with SSH keys. Specifically, you must add your public SSH key to the project or instance metadata, and store your private key on the local machine from which you want to connect. There are other advanced methods to connect to an instance.
I would also recommend to check if you have firewall rule for port 22 which is required for SSH. You can go to the VPC Network from Cloud Console and then Firewall Rules tab, check if you have firewall rule for port 22 and that rule applied to affected instance or not. If there no firewall rule for port 22, create firewall rule and apply to the affected instance.
You can also follow this SSH troubleshooting steps mentioned at this link.
I have the same problem and after recreating 4 instances and going thru every possible ssh key scenario I decided to try chrome and it worked fine whereas in firefox i get the blank black screen after the key handshake. I watched thru the serial port and the sys log showed all of the same entries for my broken web ssh session in firefox as it did for the working chrome web ssh session which means it has to be a problem with firefox.
Same issue. Ad blocker was to blame. Try whitelisting, disabling or use a private window.

Unable to create server groups(create without tempplate) in gcp

I am following the code labs https://www.spinnaker.io/guides/tutorials/codelabs/gce-source-to-prod/ but I am facing a problem in creating server group in STEP-1. (Deploy stage). The page is getting loaded for infinite time. I think I can say It is not going beyond that point. I am able to come up to this step only if I am using AZURE or any other local machines. If I use Google Cloud Instance to do SSH tunneling I am not even able to create a application. Can you please help me.
You might need to do some additional troubleshooting to determine where the problem is. For example, run netstat on the machine to see whether it's listening on port 9000. See if you can create a firewall rule allowing inbound traffic on that port and then try to connect directly without using the SSH tunnel.

Google Cloud Instances Firewall Unable to Login SSH

I logged to my ssh in google cloud Linux Machine by mistake i changed firewall rule and i lost ssh connection. now i am not able login to ssh(22), Is there any way to recover that ?
I know I can take shanpshots of my machine and create new instances using that snapshot. but is there anyway to get again ssh login in same machine or i have to delete it.
Try connecting to the instance via the serial console: https://cloud.google.com/compute/docs/instances/interacting-with-serial-console. From there you should be able to repair the firewall rules.
pjhsea I tried your steps and it is connecting to serial port but it asks passphrase. I was not sure where I have given this passphrase. If you try to access serial port on gcloud console then it always asks for passphrase.
So I tried below steps and I was able to connect to serial port to change firewall setting on my ubuntu VM.
Goto Compute Engine -> VM Instances fro left side menu.
Click on name of the VM you are facing issue connecting using SSH.
It will open VM Instance details page.
On details tab under VM name there will be two dropdown for remote access.
SSH and Connect to serial console.
Click on serial console and select serial port 1(console)
This connect to serial console without any passphrase and I was able to change my firewall rules using below command.
ufw allow 22
Now you should be able to connect using SSH.