Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Initial Connection to AWS Server
  2. Download AWS .pem ssh key and place in ~/.ssh folder
  3. $ ssh -i ~/path/to/pem/file/pem_file_name.pem ec2-user@{{amazon_ip_address}}
  4.  
  5. //adds user
  6. $ sudo adduser {{username}}
  7. //grants user root privileges
  8. $ sudo usermod -aG sudo {{username}}
  9. //switch to the new user
  10. $ su - {{username}}
  11. //make ssh folder
  12. $ mkdir ~/.ssh
  13. $ chmod 700 ~/.ssh
  14. //open authorized_keys file and copy in your local public key (id_rsa.pub)
  15. $ vim ~/.ssh/authorized_keys
  16. //limit authorized_keys permissions
  17. $ chmod 600 ~/.ssh/authorized_keys
  18.  
  19. //To connect from local
  20. //alias can be added to ~/.ssh/config (optional)
  21. $ ssh {{username}}@{{amazon_ip_address}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement