Create an SSH Tunnel

An SSH tunnel to an Oracle SOA Suite on Marketplace VM enables you to connect to other non-public ports on the VM through a port on your local machine.

You can create access rules to an Oracle SOA Suite on Marketplace instance as an alternative to creating an SSH tunnel. However, use caution and consider possible security implications before opening up ports to external access.

If a resource provided by a VM uses a port that is not directly accessible through the Internet, you can access that resource by creating an SSH tunnel to the port. For example, you can use an SSH tunnel to connect a local Integrated Development Environment (IDE) such as Eclipse to the dedicated deployment port (9001) of the Administration Server.

In general an SSH tunnel may map a remote port to any available port number on your local machine. However, port 9001 on the Administration Server uses JMX/RMI for communication, which requires that the remote and local port numbers be the same value. Therefore, the following instructions configure the tunnel’s local port number to the same value as the VM’s port number.

To set up an SSH tunnel to an Administration Server VM:

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Compute. Under Compute, click Instances.
  3. Click the instance associated with the VM you want to access.
  4. Note the Public IP Address of the Administration Server VM.
  5. On UNIX and UNIX-like platforms, use ssh to create an SSH tunnel to the VM:
    ssh -i path_to_private_key -L port:VM_IP_address:port opc@VM_IP_address -N

    where:

    • path_to_private_key is the path to the private key corresponding to the public key used at the time of provisioning.

    • VM_IP_address is the VM’s public IP address.

    • port is the port number on the VM to which you want to connect. The SSH tunnel will enable connectivity to this remote port though the same port number on your local machine.

    For example, to create an SSH tunnel to port 9001 on the Administration Server VM:
    ssh -i /home/myuser/id_rsa -L 9001:111.111.111.111:9001 opc@111.111.111.111 -N
  6. On Windows, you can use PuTTY, an open source networking client for the Windows platform, to create an SSH tunnel to the VM.

    To download PuTTY, go to http://www.putty.org/ and click the link to download PuTTY.

    1. Launch PuTTY.
      The PuTTY Configuration window is displayed, showing the Session panel.
    2. In the Host Name (or IP address) field, enter the public IP address of the VM.
    3. In the Category tree, expand Connection if necessary and then click Data.
    4. In the Auto-login username field, enter opc.
    5. Confirm that the When username is not specified option is set to Prompt.
    6. In the Category tree, click Connection > SSH.
    7. Under Protocol options, select the checkbox Don't start a shell command at all.
    8. In the Category tree, expand Connection > SSH, and then click Auth.
    9. Under Private key file for authentication, click Browse.
    10. Navigate to and select your private key file. Then click Open.

      Note:

      The .ppk file extension indicates that the private key is in PuTTY's proprietary format. You must use a key of this format when using PuTTY. If you have to use a key saved in a different format, see the PuTTY documentation.
    11. In the Category tree, click Connection > SSH > Tunnels.
    12. In the Destination field, enter IP:port
      where IP is the IP address of the VM and port is the port number on the VM to which you want to connect.
    13. In the Source Port field, enter the same port number.
    14. Click the Add button.
    15. Click Open to create the SSH tunnel to the VM.

      Note:

      You can optionally save this session configuration by navigating to the Session panel and clicking Save. When you open PuTTY the next time, you can load this configuration by selecting it and clicking Load.
  7. If the private key was defined with a passphrase, enter this value when prompted.

Applications running on your local machine can now communicate with the VM by using localhost:port, where port is the local port number.

For example, after creating an SSH tunnel to port 9001 on the Administration Server VM, launch a web browser and connect to http://localhost:9001/console.

Note:

After your work with the SSH tunnel is complete, press Ctrl+C to shut down the SSH tunnel.