Tạo SSH Key

Tạo SSH key

  1. Chúng ta thực hiện lệnh để generate SSH key trong Cloud9. Key này sẽ được sử dụng truy cập vào node instance

Chúng ta có thể truy cập bằng lệnh: ssh -i PRIVATE_KEY.PEM ec2-user @ EC2_PUBLIC_DNS_NAME

ssh-keygen

Set up

  1. Chúng ta thực hiện upload public key vào EC2 region
aws ec2 import-key-pair --key-name "mythicaleks" --public-key-material file://~/.ssh/id_rsa.pub

Nếu gặp lỗi An error occurred (InvalidKey.Format) when calling the ImportKeyPair operation: Key is not in valid OpenSSH public key format, bạn có thể thử lệnh sau:

aws ec2 import-key-pair --key-name "mythicaleks" --public-key-material fileb://~/.ssh/id_rsa.pub

Set up

  1. Truy cập vào EC2
  • Chọn Key pair
  • Xem key đã được upload vào EC2 region

Set up