Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rutvij-pandya/ba2741f9eff9467ccb7d736f593a373c to your computer and use it in GitHub Desktop.
Save rutvij-pandya/ba2741f9eff9467ccb7d736f593a373c to your computer and use it in GitHub Desktop.
AWS Part 2-Add Key to NAT/App instance
Each server has .ssh/authorized_keys file
Each SSH key has Private & Public key
Copy content within Pub key of relevant Private key & paste it in relevant server's .ssh/authorized_keys file
>> vi .ssh/test_ssh.pub
>> Copy content
>> ssh-nat (alias)
>> ssh-learn (alias)
>> vi .ssh/authorized_keys
>> i - Paste content
>> :wq - save
Try connecting to server with newly added ssh key
>> ssh -i ~/.ssh/foo-key-pair.pem ec2-user@1.1.1.1 # use actual server ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment