Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating SOCKS session on OCI bastion fails on Windows #866

Open
jlecerf62 opened this issue Nov 3, 2024 · 2 comments
Open

Creating SOCKS session on OCI bastion fails on Windows #866

jlecerf62 opened this issue Nov 3, 2024 · 2 comments

Comments

@jlecerf62
Copy link

--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)

@pankajmjx
Copy link
Member

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

@jlecerf62
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants