Jakob
Jakob

Reputation: 41

Can't connect to my Oracle Virtual Cloud Instance

the Terminal just says:

ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection timed out

Here are the firewall rules.

I can't ssh into the VM so I cant change the firewall rules on the VM

Please Help.

Upvotes: 2

Views: 3900

Answers (2)

ColCh
ColCh

Reputation: 3063

You can mount your machine drive to some other machine, edit sshd config and mount it back.

That helped me :D

See this ref: https://blogs.oracle.com/cloud-infrastructure/post/recovering-opc-user-ssh-key-on-oracle-cloud-infrastructure

Upvotes: 1

VonC
VonC

Reputation: 1323953

First, double-check your IP address: it must match your Oracle Virtual Cloud Public IP Address, assuming it is a reserved one (meaning it is a fixed one)

Second, check your local firewall: you cannot change the remote ones, but the local rules might still block your SSH traffic.

As mentioned here:

ust by opening the port through firewall and security lists will not allow new incoming connections. Ex: unless there is a service listening on port 443 (Tomcat etc), you will be unable to connect. Same with SSH daemon for port 22.

So make sure the SSH daemon is up and running.

Check also Default Security List

Unlike other security lists, the default security list comes with an initial set of stateful rules, which should in most cases be changed to only allow inbound traffic from authorized subnets relevant to the region that homes that VCN or subnet.

A list of authorized subnet ranges relevant to each region can be found here .

In particular:

Stateful ingress: Allow TCP traffic on destination port 22 (SSH) from authorized source IP addresses and any source port.

This rule makes it easy for you to create a new cloud network and public subnet, launch a Linux instance, and then immediately use SSH to connect to that instance without needing to write any security list rules yourself.

Upvotes: 1

Related Questions