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

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  
主站蜘蛛池模板: 卫辉市| 三门县| 辽中县| 察哈| 河源市| 奉化市| 防城港市| 隆回县| 彩票| 靖边县| 广昌县| 广丰县| 康定县| 和平区| 华亭县| 舟曲县| 上思县| 来宾市| 新和县| 常德市| 洮南市| 怀安县| 庄浪县| 淅川县| 长阳| 独山县| 湖南省| 夏津县| 延庆县| 霸州市| 曲阳县| 抚顺县| 伊宁县| 兴海县| 丹阳市| 澄江县| 灌南县| 睢宁县| 陆河县| 桦南县| 洛浦县|