官术网_书友最值得收藏!

Generating your ssh keys

By default, Amazon EC2 uses ssh key pairs to give you ssh access to your EC2 instances. You can either generate a key pair in EC2 and download the private key or generate a key yourself using a third-party tool such as OpenSSL and import the public key in EC2. We will use the first method:

$ aws ec2 create-key-pair --key-name EffectiveDevOpsAWS
{
  "KeyMaterial": "-----BEGIN RSA PRIVATE KEY-----
\nMIIEogIBAAKCAQEAo6vZQ0BxnqdfZOSdcI66KRvypX0NwH5IEi6GUw06+
[...] sj4FAZVLp4OpaIeg+DxHaXUMx\njVHiSRmxmXv2NJAaiJr/q4wMq+eUq3WLn/DKbIPWkfB5lqnGF2T/biie7igSvder3xE=\n-----END RSA PRIVATE KEY-----", "KeyName": "EffectiveDevOpsAWS", "KeyFingerprint": "d2:ec:b5:07:af:83:74:4c:9c:5f:d1:3c:37:86:1b:f0:9c:1b:c1:cf" }

The key is located in the KeyMaterial section of the JSON output. Save this output in a file. I recommend copying the output and using echo <paste> > file as this will interpret the \n characters:

$ echo "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBAAKCAQEAo6vZQ0BxnqdfZOSdcI66KRvypX0NwH5IEi6GUw06+
[...]
sj4FAZVLp4OpaIeg+DxHaXUMx\njVHiSRmxmXv2NJAaiJr/q4wMq+eUq3WLn/DKbIPWkfB5lqnGF2T/biie7igSvder3xE=\n-----END RSA PRIVATE KEY-----" > ~/.ssh/EffectiveDevOpsAWS.pem
$ chmod 600 ~/.ssh/EffectiveDevOpsAWS.pem  
主站蜘蛛池模板: 镇沅| 土默特右旗| 深水埗区| 滁州市| 双鸭山市| 望江县| 甘德县| 海丰县| 渑池县| 射阳县| 且末县| 桑植县| 漳浦县| 福海县| 驻马店市| 德惠市| 洛浦县| 沭阳县| 辽阳县| 兴安盟| 北安市| 绥化市| 杂多县| 达孜县| 翼城县| 宁河县| 吴忠市| 满洲里市| 六安市| 舒城县| 桦川县| 凌海市| 成武县| 霍城县| 威远县| 喀什市| 天全县| 桃江县| 句容市| 平遥县| 巫溪县|