How to copy keypair(pem) to Amazon EC2 instance

See more articles in OS/Linux / Unix category

To copy Amazon keypair(.pem) file, I am going to use scp command with the keypair I have.

# go to the directory where your keypair file is
# My keypair name is amazonkey.pem
# My EC2 instance DNS name is ec2-50-19-67-185.compute-1.amazonaws.com
# I am going to copy the keypair file to ~/ directory on EC2 instance

 

So, the command is

scp -i amazonkey.pem amazonkey.pem root@ec2-50-19-67-185.compute-1.amazonaws.com:~/

 

 
저작자 표시 비영리 변경 금지