🚪Change ssh port
Compared to other Clouds, OCI requires some extra steps to avoid getting locked out.
Last updated
Compared to other Clouds, OCI requires some extra steps to avoid getting locked out.
Last updated
From the OCI control panel navigate to Compute > Instances and select your instance. You should see something like this:
Click on the subnet:
Next, either make a new Security List, or simply edit the Default:
Add a new Ingress Rule:
In the following panel enter the required information:
Source Type: CIDR
Source CIDR: either 0.0.0.0/0 or <the-ip-you'll-be-connecting-from>/32
IP Protocol: TCP
Destination Port Range: <the-port-you-want-to-use-for-ssh>
Description: something that makes sense to you
Please note: DO NOT delete the default SSH (port 22) Ingress Rule at this point
Next, connect to your instance as you did here and change SSH port on the VM:
More details about this process can be found here.
Please note: you must include the following steps for this to work in OCI
Install firewalld and set new rules:
Please note: before disconnecting your current session, open a new Terminal session and ssh using your new port
A couple of links regarding this process:
Ways to manage access to OCI instances;
Problems with firewalld rules;
Controlling system access with firewalld;