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. On the Bastions list page, select the bastion that you want to create a session in. If you need help finding the list page or the bastion, see Listing Bastions.
    2. On the details page, select the Sessions tab or link.
    3. Select Create session.
    4. Select Dynamic port forwarding (SOCKS5) session.
    5. Enter a display name for the new session.

      Avoid entering any confidential information in this field.

    6. 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.

    7. (Optional) Expand Advanced options and change the maximum amount of time that any session on this bastion can remain active by entering a value for Maximum session time-to-live. Provide a value of at least 30 minutes that doesn't exceed 180 minutes (3 hours). You can delete a session before it expires.
    8. When you're finished, select 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.