Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Initial Connection to AWS Server
- Download AWS .pem ssh key and place in ~/.ssh folder
- $ ssh -i ~/path/to/pem/file/pem_file_name.pem ec2-user@{{amazon_ip_address}}
- //adds user
- $ sudo adduser {{username}}
- //grants user root privileges
- $ sudo usermod -aG sudo {{username}}
- //switch to the new user
- $ su - {{username}}
- //make ssh folder
- $ mkdir ~/.ssh
- $ chmod 700 ~/.ssh
- //open authorized_keys file and copy in your local public key (id_rsa.pub)
- $ vim ~/.ssh/authorized_keys
- //limit authorized_keys permissions
- $ chmod 600 ~/.ssh/authorized_keys
- //To connect from local
- //alias can be added to ~/.ssh/config (optional)
- $ ssh {{username}}@{{amazon_ip_address}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement