Skip to content

Instantly share code, notes, and snippets.

@oehrlis
Created June 3, 2020 07:27
Show Gist options
  • Save oehrlis/fb4ac6c075a09d3fb15fc34e3efd0547 to your computer and use it in GitHub Desktop.
Save oehrlis/fb4ac6c075a09d3fb15fc34e3efd0547 to your computer and use it in GitHub Desktop.
Deploy ssh public keys to OCI

First convert the public Key (tutorialinux.com/convert-ssh2-openssh/)

ssh-keygen -i -f ssh2.pub > openssh.pub

Upload the Key to the cloud jump host

scp openssh.pub [email protected]:~/.ssh/
ssh [email protected] 'cat ~/.ssh/openssh.pub >> ~/.ssh/authorized_keys'

And to the oud server for user oracle

scp -o 'ProxyJump [email protected]' openssh.pub oracle@oud:~/.ssh/
ssh -A -J [email protected] oracle@oud 'cat ~/.ssh/openssh.pub >> ~/.ssh/authorized_keys'

And to the oud server for user opc

scp -o 'ProxyJump [email protected]' openssh.pub opc@oud:~/.ssh/
ssh -A -J [email protected] opc@oud 'cat ~/.ssh/openssh.pub >> ~/.ssh/authorized_keys'

Additional information regarding jumphost [Oracle Cloud Infrastructure and SSH Keys – Jump! ](https://www.martinberger.com/?p=5039}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment