oci-cli icon indicating copy to clipboard operation
oci-cli copied to clipboard

Creating SOCKS session on OCI bastion fails on Windows

Open jlecerf62 opened this issue 1 year ago • 2 comments

--key-details json parameter is not recognized. It works fine on MacOS.

Usage: oci.exe bastion session create-session-create-dynamic-port-forwarding-session-target-resource-details [OPTIONS] Error: Got unexpected extra argument (publicKeyContent:\ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCdo2k3RELR3EMjq5fSNcrN+YjAgTNrpDq3bKzYzznCwACxfknSBkU0yNRNgPL3cWTQa3hiOB4faS1j59CClIRAMUG2BEO9iRKnq9ZgQ8vfDZWY...

Json parameter format is correct though. It would be better to pass a public key file like other connection modes (managed-ssh and port-forwarding)

jlecerf62 avatar Nov 03 '24 22:11 jlecerf62

Hi @jlecerf62 You can use the below commands to generate a dummy JSON file and then pass the JSON file after editing it -

oci bastion session create-session-create-dynamic-port-forwarding-session-target-resource-details --generate-param-json-input key-details>a.json
edit and modify testfile.json
oci bastion session create-session-create-dynamic-port-forwarding-session-target-resource-details --key-details file://C:\path\to\testfile.json

Document for reference - https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

pankajmjx avatar Nov 05 '24 11:11 pankajmjx

Hi @pankajmjx, I know but I would like to avoid using file:// since I'm using this command in a powershell script. I'd rather use the JSON formating in string as mentionned here: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliusing.htm#Managing_CLI_Input_and_Output

It works well on MacOS but not on Windows

jlecerf62 avatar Nov 05 '24 16:11 jlecerf62