Connect to a VM with SSH
You can connect to a virtual machine (VM) in a VM Cluster by using a Secure Shell (SSH) connection.
Most UNIX-style systems, including Linux, Oracle Solaris, and macOS, include an SSH client. For Microsoft Windows systems, you can use an SSH client such as PuTTY.
Prerequisites for Connecting to a VM
-
An SSH private key file that corresponds to a public key that is registered with the VM Cluster.
When you create a VM Cluster, you must specify the public key portion of one or more SSH key pairs. You can also register additional keys after you create the VM Cluster.
The public keys are stored in the
authorized_keysfile at~/.ssh/authorized_keys. Separateauthorized_keysfiles are located under the home directories of the operating system users. By default, only theopcuser account has anauthorized_keysentry and is able to log in remotely. Do not remove or alter the automatically generated entry inauthorized_keysfor theopcuser. -
The host name or IP address of the VM that you want to access.
Connect to a VM from a Microsoft Windows System Using PuTTY
You need the SSH private key file that matches the public key associated with the VM Cluster. This private key file must be in the PuTTY .ppk format. If the private key file was originally created on a Linux platform, you can use PuTTYgen to convert the key to the .ppk format.
-
Download and install PuTTY.
To download PuTTY, go to the PuTTY website and follow the download instructions.
-
Run the PuTTY program,
putty.exe.The PuTTY Configuration window is displayed, showing the Session panel.
-
In the Host Name (or IP address) field, enter the host name or IP address of the VM that you want to access.
-
Confirm that the Connection type option is set to SSH.
-
In the Category tree, expand Connection, if necessary, and then select Data.
The Data panel is displayed.
-
In the Auto-login username field, enter
opc.Connect as the
opcuser to perform operations that requirerootororacleaccess to the VM. Theopcuser can use thesudocommand to gainrootaccess or switch to theoracleuser. -
Confirm that the When username is not specified option is set to Prompt.
-
In the Category tree, expand SSH, and then select Auth.
The Auth panel is displayed.
-
Select Browse next to the Private key file for authentication field.
-
In the select private key file window, navigate to and open the private key file that matches the public key associated with the VM Cluster.
-
In the Category tree, select Session.
The Session panel is displayed.
-
In the Saved Sessions field, enter a name for the connection configuration, and then select Save.
-
Select Open to open the connection.
The PuTTY Configuration window closes and the PuTTY terminal window is displayed.
If this is the first time you are connecting to the VM, the PuTTY security alert window is displayed, prompting you to confirm the public key. Select Yes to continue connecting.
Connect to a VM from a UNIX-Style System
Enter the following SSH command:
ssh -i private-key user@node
where:
private-keyis the full path and name of the file that contains the SSH private key corresponding to a public key that is registered with the VM Cluster.useris the operating system user that you want to use to connect.nodeis the host name or IP address of the VM that you want to access.
To perform operations that require root access to the VM, connect as the opc user.
The opc user can use the following command to gain root access:
sudo -s
To perform operations as the Oracle AI Database software owner, connect as the opc user and then switch to the oracle user.
sudo su - oracle