Justin의 개발 로그

SSH to your EC2 Instance as standard ec2-user

 

sudo adduser -m testuser
sudo su - testuser
mkdir .ssh
chmod 700 .ssh
touch .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

 

On your local pc, if you don't have them already, generate rsa keys (always give enter on default options)

 

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub 

Copy the output (something like this)

ssh-rsa AAAAB3N.......Psut95c237gtzkwlU7iAOeiPWJduMV/bPxXnrB/YqF+XwRMuiz testuser@testEC2

and paste into the .ssh/authorized_keys of your testuser of testinstance (using vi or nano or whatever)

 

from your client ssh to your ec2

 

ssh testuser@ip.e.c.2

 

This will work. I don't really get the Amazon way of sharing and setting up pem keys. I think it is easier for their automated systems but not for sysadmins. You can use your public key that way on all the servers you need to admin.

profile

Justin의 개발 로그

@라이프노트

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!