Creating a Dynamic Port Forwarding (SOCKS 5) Session in Bastion

Create a dynamic port forwarding (SOCKS5) session.

Ensure that you have the public key file of the SSH key pair that you plan to use to connect to the session. To learn more, see Managing Key Pairs on Linux Instances.

    1. Open the navigation menu and click Identity & Security. Click Bastion.
    2. Under List scope, select the compartment where you want to create a bastion session.
    3. Click the name of the bastion.
    4. Click Create session.
    5. Choose Dynamic port forwarding (SOCKS5) session.
    6. Enter a display name for the new session.

      Avoid entering any confidential information in this field.

    7. Under Add SSH key, provide the public key file of the SSH key pair that you want to use for the session.

      Later, when you connect to the session, you must provide the private key of the same SSH key pair.

    8. (Optional) To change the maximum amount of time that the session can remain active, click Show advanced options, and then enter a value for Maximum session time-to-live.

      Provide a value that's at least 30 minutes, but doesn't exceed the maximum TTL of the bastion. The default is 180 minutes or three hours.

      You can also delete a session before it expires.

    9. When you're finished, click Create session.
  • Use the oci bastion session create-session-create-dynamic-port-forwarding-session-target-resource-details command and required parameters to create a dynamic port forwarding (SOCKS 5) session:

    oci bastion session create-dynamic-port-forwarding --bastion-id <bastion_ocid> --key-details <key_details> [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • Run the CreateSession operation to create a dynamic port forwarding session.