Skip to content

Instantly share code, notes, and snippets.

View daddychukz's full-sized avatar
🏠
Working from home

Durugo Chuka daddychukz

🏠
Working from home
View GitHub Profile
@daddychukz
daddychukz / ssh_without_pem
Created June 1, 2020 18:06 — forked from kevinjam/ssh_without_pem
Access EC2 Linux box over ssh without .pem file SHELL SSH AWS AMAZON LINUX EC2 BASH You may be in the situation where you need to access your EC2 instance from any machine, not necessarily your own. It's a pain to carry around your .pem file and a bad idea to leave it on someone elses machine too. Here's a solution to let you login to your insta…
1. Login to your EC2 instance using your .pem file
ssh -i your_pem_file.pem ubuntu@ec2-________.compute-1.amazonaws.com
2. Create a new user that will access the instance using a password:
$ sudo useradd -s /bin/bash -m -d /home/USERNAME -g root USERNAME
where:
-s /bin/bash : use /bin/bash as the standard shell
-m -d /home/USERNAME : create a home directory at /home/USERNAME