Task 7: Connect to Your Instance
Connect to your instance using SSH.
In most cases, you connect to a running instance using a Secure Shell (SSH) connection. Some instances support authenticating your connection with a password. This tutorial assumes you used one of the images provided on Compute Cloud@Customer, which creates an instance that authenticates your SSH connection with an SSH key pair.
For the system that you will be connecting from, most Linux and other UNIX operating systems include an SSH client by default.
Microsoft Windows 10 and Microsoft Windows Server 2019 systems should include the OpenSSH client, which you'll need if you created your instance using the SSH keys generated by Oracle Cloud Infrastructure. For other Microsoft Windows versions, you can download a free SSH client called PuTTY.
Before You Begin
-
Get the public IP address of your instance, as described in Task 6: Get the Instance IP Address.
-
Get the path to your private key file.
-
Get the valid user name.
The user name is configured in the image used to launch the instance. If you launched an instance using one of the platform images that is provided on the Compute Cloud@Customer, the default user is
opc
. See Initial User Account.
-
Open a terminal window.
-
Use the
ssh
command to connect to your instance.Syntax:
ssh –i private_key_pathname username@public-ip-address
-
private_key_pathname
is the full path name of the file that contains the private key associated with the instance you want to access. -
username
is the default username for the instance. For this tutorial,opc
is the username. -
public-ip-address
is your instance IP address.
Example:
$ ssh -i /home/flast/.ssh/my_private_key opc@192.0.2.1
-
-
If asked whether you want to continue connecting, type
yes
.You are now logged in to your instance.
Perform the next task:
This connection method is commonly performed from Microsoft Windows systems.
Use this procedure if the instance uses a key pair that you created using the PuTTY Key Generator. See Creating an SSH Key Pair Using PuTTY Key Generator.
-
Open PuTTY.
-
In the Category pane (on the left), select Session and enter the following:
-
Host Name (or IP address):
username@public-ip-address
-
username
is the default username for the instance. For this tutorial, the username isopc
. -
public-ip-address
is your instance IP address.
-
-
Port: 22
-
Connection type: SSH
-
-
In the Category pane, expand Window, and then select Translation.
-
In the Remote character set drop-down list, select UTF-8. The default locale setting on Linux-based instances is UTF-8, and this setting configures PuTTY to use the same locale.
-
In the Category pane, expand Connection, expand SSH, and then click Auth.
-
Click Browse, and then select your
.ppk
private key file. -
Click Open to start the session.
If this is your first time connecting to the instance, you might see a message that the server's host key isn't cached in the registry. Click Yes or Accept to continue the connection.
If the connection fails, you might need to update your PuTTY proxy configuration.
Perform the next task: