How to create aws ec2 private-public key pairBest way to use multiple SSH private keys on one clientHow to specify the private SSH-key to use when executing shell command on Git?Change key pair for ec2 instanceExtract public/private key from PKCS12 file for later use in SSH-PK-AuthenticationCalculate RSA key fingerprintcreating a private key for AWS EC2 InstancePermission denied (publickey) when SSH Access to Amazon EC2 instancecreate an ec2 instance with multiple key pairsAllowing users to SSH into EC2 Linux Instance with key pairsProtecting private key generated for AWS EC2

Break down the phrase "shitsurei shinakereba naranaindesu"

Coupling two 15 Amp circuit breaker for 20 Amp

ELI5 what is SMTChecker?

Is "prohibition against," a double negative?

A vector is defined to have a magnitude and *a* direction, but the zero vector has no *single* direction. So, how is the zero vector a vector?

Is this statement about a motion being simple harmonic in nature strong?

How were US credit cards verified in-store in the 1980's?

What is the motivation behind designing a control stick that does not move?

How do I get my neighbour to stop disturbing with loud music?

Create a list of snaking numbers under 50,000

What checks exist against overuse of presidential pardons in the USA?

Heavy Box Stacking

Am I required to correct my opponent's assumptions about my morph creatures?

German equivalent to "going down the rabbit hole"

How to save money by shopping at a variety of grocery stores?

Calculate Landau's function

'spazieren' - walking in a silly and affected manner?

Ask one verbal question to figure out who is blind and who is mute among three persons

Resources to learn about firearms?

Why doesn't Starship have four landing legs?

How is the anglicism "jackpot" commonly expressed in French?

Do universities maintain secret textbooks?

How is the casino term "a high roller" commonly expressed in German?

Why do IR remotes influence AM radios?



How to create aws ec2 private-public key pair


Best way to use multiple SSH private keys on one clientHow to specify the private SSH-key to use when executing shell command on Git?Change key pair for ec2 instanceExtract public/private key from PKCS12 file for later use in SSH-PK-AuthenticationCalculate RSA key fingerprintcreating a private key for AWS EC2 InstancePermission denied (publickey) when SSH Access to Amazon EC2 instancecreate an ec2 instance with multiple key pairsAllowing users to SSH into EC2 Linux Instance with key pairsProtecting private key generated for AWS EC2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I'm following this guide of creating aws environment. Now after I created my environment I want to ssh to the ec2.



What I need is to create private-public key pair, which I don't know how.



at the beginning of the guide, it tells:



Generate public key from private key
ssh-keygen -y -f ~/.ssh/pemfile/mumbai.pem


But how I create a mumbai.pem file on my host?
Is there a command to download create this pem, or I need to download it from aws?
I'm really new with aws, I hope this is not too obvious.










share|improve this question
























  • If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

    – user9105725
    Mar 27 at 23:32











  • But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

    – user9105725
    Mar 27 at 23:35


















-1















I'm following this guide of creating aws environment. Now after I created my environment I want to ssh to the ec2.



What I need is to create private-public key pair, which I don't know how.



at the beginning of the guide, it tells:



Generate public key from private key
ssh-keygen -y -f ~/.ssh/pemfile/mumbai.pem


But how I create a mumbai.pem file on my host?
Is there a command to download create this pem, or I need to download it from aws?
I'm really new with aws, I hope this is not too obvious.










share|improve this question
























  • If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

    – user9105725
    Mar 27 at 23:32











  • But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

    – user9105725
    Mar 27 at 23:35














-1












-1








-1








I'm following this guide of creating aws environment. Now after I created my environment I want to ssh to the ec2.



What I need is to create private-public key pair, which I don't know how.



at the beginning of the guide, it tells:



Generate public key from private key
ssh-keygen -y -f ~/.ssh/pemfile/mumbai.pem


But how I create a mumbai.pem file on my host?
Is there a command to download create this pem, or I need to download it from aws?
I'm really new with aws, I hope this is not too obvious.










share|improve this question














I'm following this guide of creating aws environment. Now after I created my environment I want to ssh to the ec2.



What I need is to create private-public key pair, which I don't know how.



at the beginning of the guide, it tells:



Generate public key from private key
ssh-keygen -y -f ~/.ssh/pemfile/mumbai.pem


But how I create a mumbai.pem file on my host?
Is there a command to download create this pem, or I need to download it from aws?
I'm really new with aws, I hope this is not too obvious.







amazon-web-services ssh key-pair






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 23:30









YagelYagel

3691 gold badge3 silver badges12 bronze badges




3691 gold badge3 silver badges12 bronze badges















  • If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

    – user9105725
    Mar 27 at 23:32











  • But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

    – user9105725
    Mar 27 at 23:35


















  • If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

    – user9105725
    Mar 27 at 23:32











  • But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

    – user9105725
    Mar 27 at 23:35

















If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

– user9105725
Mar 27 at 23:32





If you are using Windows, use Putty and Pageant. Linux, that command will probably work.

– user9105725
Mar 27 at 23:32













But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

– user9105725
Mar 27 at 23:35






But, when you create the ec2 instance, it gives you the key though. Make sure port 22 is open through VPC for SSH. 3389 for RDP. So, you don’t need to make a key. It will give you one, you just need to remember to save it.

– user9105725
Mar 27 at 23:35













2 Answers
2






active

oldest

votes


















2















Just run ssh-keygen and it should prompt you for details on where to create the key. Just note: If you run this command on your local machine, it will generate both the public key and the private key. In this case, you will need to Import Your Own Public Key to Amazon EC2. This method works better for terraform as you can put the text value output of your public key into the aws_key_pair resource easily.



If you create the key via the ec2 console, AWS will keep the public key in the system automatically and your browser will download the private key. See Creating a Key Pair Using Amazon EC2. (this second approach will save you having to upload it to ec2 keypairs). This method also works with the aws_key_pair resource, however you'll have to import the existing resource into terraform. It's simpler to use the first approach.



If you're doing it all via terraform, check out aws_key_pair






share|improve this answer


































    1















    First of all, it may be too much if you're new to AWS
    The tutorial you're using equiped servers with Terraform, which is a 3rd party tool out of AWS



    You may consider a much more intuitive turtorial to create your first instance from AWS console, and AWS will help to generate a key-pair, and you will have the full control



    In the other hand, this article is an advaced one, it's trying to automate all infra work including instance creation, network and etc. It's useful but may be too complicated to follow



    So back to your question, TF will inject the public key generated based on mumbai.pem, into the new server created in this code snippet:



    # Define SSH key pair for our instances
    resource "aws_key_pair" "default"
    key_name = "mumbai"
    public_key = "$file("$var.key_path")"



    It's not too obivious as the author is so familiar with TF and he skips the basic part






    share|improve this answer



























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388047%2fhow-to-create-aws-ec2-private-public-key-pair%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2















      Just run ssh-keygen and it should prompt you for details on where to create the key. Just note: If you run this command on your local machine, it will generate both the public key and the private key. In this case, you will need to Import Your Own Public Key to Amazon EC2. This method works better for terraform as you can put the text value output of your public key into the aws_key_pair resource easily.



      If you create the key via the ec2 console, AWS will keep the public key in the system automatically and your browser will download the private key. See Creating a Key Pair Using Amazon EC2. (this second approach will save you having to upload it to ec2 keypairs). This method also works with the aws_key_pair resource, however you'll have to import the existing resource into terraform. It's simpler to use the first approach.



      If you're doing it all via terraform, check out aws_key_pair






      share|improve this answer































        2















        Just run ssh-keygen and it should prompt you for details on where to create the key. Just note: If you run this command on your local machine, it will generate both the public key and the private key. In this case, you will need to Import Your Own Public Key to Amazon EC2. This method works better for terraform as you can put the text value output of your public key into the aws_key_pair resource easily.



        If you create the key via the ec2 console, AWS will keep the public key in the system automatically and your browser will download the private key. See Creating a Key Pair Using Amazon EC2. (this second approach will save you having to upload it to ec2 keypairs). This method also works with the aws_key_pair resource, however you'll have to import the existing resource into terraform. It's simpler to use the first approach.



        If you're doing it all via terraform, check out aws_key_pair






        share|improve this answer





























          2














          2










          2









          Just run ssh-keygen and it should prompt you for details on where to create the key. Just note: If you run this command on your local machine, it will generate both the public key and the private key. In this case, you will need to Import Your Own Public Key to Amazon EC2. This method works better for terraform as you can put the text value output of your public key into the aws_key_pair resource easily.



          If you create the key via the ec2 console, AWS will keep the public key in the system automatically and your browser will download the private key. See Creating a Key Pair Using Amazon EC2. (this second approach will save you having to upload it to ec2 keypairs). This method also works with the aws_key_pair resource, however you'll have to import the existing resource into terraform. It's simpler to use the first approach.



          If you're doing it all via terraform, check out aws_key_pair






          share|improve this answer















          Just run ssh-keygen and it should prompt you for details on where to create the key. Just note: If you run this command on your local machine, it will generate both the public key and the private key. In this case, you will need to Import Your Own Public Key to Amazon EC2. This method works better for terraform as you can put the text value output of your public key into the aws_key_pair resource easily.



          If you create the key via the ec2 console, AWS will keep the public key in the system automatically and your browser will download the private key. See Creating a Key Pair Using Amazon EC2. (this second approach will save you having to upload it to ec2 keypairs). This method also works with the aws_key_pair resource, however you'll have to import the existing resource into terraform. It's simpler to use the first approach.



          If you're doing it all via terraform, check out aws_key_pair







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 28 at 5:28

























          answered Mar 28 at 5:19









          MoeMoe

          1,0583 silver badges14 bronze badges




          1,0583 silver badges14 bronze badges


























              1















              First of all, it may be too much if you're new to AWS
              The tutorial you're using equiped servers with Terraform, which is a 3rd party tool out of AWS



              You may consider a much more intuitive turtorial to create your first instance from AWS console, and AWS will help to generate a key-pair, and you will have the full control



              In the other hand, this article is an advaced one, it's trying to automate all infra work including instance creation, network and etc. It's useful but may be too complicated to follow



              So back to your question, TF will inject the public key generated based on mumbai.pem, into the new server created in this code snippet:



              # Define SSH key pair for our instances
              resource "aws_key_pair" "default"
              key_name = "mumbai"
              public_key = "$file("$var.key_path")"



              It's not too obivious as the author is so familiar with TF and he skips the basic part






              share|improve this answer





























                1















                First of all, it may be too much if you're new to AWS
                The tutorial you're using equiped servers with Terraform, which is a 3rd party tool out of AWS



                You may consider a much more intuitive turtorial to create your first instance from AWS console, and AWS will help to generate a key-pair, and you will have the full control



                In the other hand, this article is an advaced one, it's trying to automate all infra work including instance creation, network and etc. It's useful but may be too complicated to follow



                So back to your question, TF will inject the public key generated based on mumbai.pem, into the new server created in this code snippet:



                # Define SSH key pair for our instances
                resource "aws_key_pair" "default"
                key_name = "mumbai"
                public_key = "$file("$var.key_path")"



                It's not too obivious as the author is so familiar with TF and he skips the basic part






                share|improve this answer



























                  1














                  1










                  1









                  First of all, it may be too much if you're new to AWS
                  The tutorial you're using equiped servers with Terraform, which is a 3rd party tool out of AWS



                  You may consider a much more intuitive turtorial to create your first instance from AWS console, and AWS will help to generate a key-pair, and you will have the full control



                  In the other hand, this article is an advaced one, it's trying to automate all infra work including instance creation, network and etc. It's useful but may be too complicated to follow



                  So back to your question, TF will inject the public key generated based on mumbai.pem, into the new server created in this code snippet:



                  # Define SSH key pair for our instances
                  resource "aws_key_pair" "default"
                  key_name = "mumbai"
                  public_key = "$file("$var.key_path")"



                  It's not too obivious as the author is so familiar with TF and he skips the basic part






                  share|improve this answer













                  First of all, it may be too much if you're new to AWS
                  The tutorial you're using equiped servers with Terraform, which is a 3rd party tool out of AWS



                  You may consider a much more intuitive turtorial to create your first instance from AWS console, and AWS will help to generate a key-pair, and you will have the full control



                  In the other hand, this article is an advaced one, it's trying to automate all infra work including instance creation, network and etc. It's useful but may be too complicated to follow



                  So back to your question, TF will inject the public key generated based on mumbai.pem, into the new server created in this code snippet:



                  # Define SSH key pair for our instances
                  resource "aws_key_pair" "default"
                  key_name = "mumbai"
                  public_key = "$file("$var.key_path")"



                  It's not too obivious as the author is so familiar with TF and he skips the basic part







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 28 at 3:35









                  Calvin ZhouCalvin Zhou

                  1491 silver badge5 bronze badges




                  1491 silver badge5 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388047%2fhow-to-create-aws-ec2-private-public-key-pair%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현