Skip to content

Instantly share code, notes, and snippets.

@lucianovalenca
Last active June 3, 2020 01:59
Show Gist options
  • Select an option

  • Save lucianovalenca/ad622cc7738b6e00179e8f1558d3a157 to your computer and use it in GitHub Desktop.

Select an option

Save lucianovalenca/ad622cc7738b6e00179e8f1558d3a157 to your computer and use it in GitHub Desktop.
## Step 1 — Create the RSA Key Pair
$ `ssh-keygen -f my_key_filename`
## Step 2 — Copy the Public Key to Ubuntu Server
`
cat /c/Temp/mkt_id_rsa.pub | ssh -i "/c/Users/lucia/OneDrive/Trabalho/Keys/AWS/take5/WebServers_OLD.pem" ubuntu@ec2-18-229-198-157.sa-east-1.compute.amazonaws.com "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
`
## Step 3 — Connect
The step 1 generates 2 files, open the PEM file (the one without extension) in PuttyGen (Load an existing Private Key file) and save as ppk. Use the ppk in WinSCP to connect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment