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

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  
主站蜘蛛池模板: 铜陵市| 高唐县| 新民市| 广东省| 全南县| 东山县| 长兴县| 广灵县| 塘沽区| 灵台县| 酒泉市| 平泉县| 青阳县| 读书| 西林县| 泗水县| 宁远县| 迁西县| 瑞昌市| 瓦房店市| 无极县| 邯郸市| 宁强县| 嘉义市| 长丰县| 桓仁| 贺州市| 孝义市| 江安县| 镇原县| 洛浦县| 绥化市| 林周县| 富民县| 平南县| 保山市| 库尔勒市| 昌乐县| 蓬安县| 张家口市| 海口市|