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 opc@jumphost.trivadislabs.com:~/.ssh/
ssh opc@jumphost.trivadislabs.com 'cat ~/.ssh/openssh.pub >> ~/.ssh/authorized_keys'

And to the oud server for user oracle

scp -o 'ProxyJump opc@jumphost.trivadislabs.com' openssh.pub oracle@oud:~/.ssh/
ssh -A -J opc@jumphost.trivadislabs.com oracle@oud 'cat ~/.ssh/openssh.pub >> ~/.ssh/authorized_keys'

And to the oud server for user opc

scp -o 'ProxyJump opc@jumphost.trivadislabs.com' openssh.pub opc@oud:~/.ssh/
ssh -A -J opc@jumphost.trivadislabs.com 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