


So till now we have created the key as well started the AWS ec2 instance which is also up and running. SSH into EC2 instance using the aws_key.pem key If you successfully started your EC2 instance then you will following under the EC2 dashboard of AWS -Ģ. Go to your AWS console and look for the number of EC2 instances running. SSH into EC2 instance using the aws_key.pem key.You can simply run the following commands in the same sequence one after another -Īfter provisioning/starting the EC2 instance, we need to verify two things. For opening port 22 you need to create a security group and attach the security group to aws instance.
#SSH CLIENT FOR MAC .PEM HOW TO#
(*Note - If this is your first time with terraform and you have not worked before then I would recommend you to go through an article on How to install terraform and How to create EC2 instance on AWS)ġprovider "aws" Here is the content of the public key aws_key.pub(you can open the file in any editor of your choice) -Ģb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcnģNhAAAAAwEAAQAAAQEA270Tf4L0AYRXvnRPKd0POuU/8UyoI6k44+eqdSCCm6vEg8jsmxPIĤmtKzD3ASwCnbPsI3jyGKU7UcU/VLFG2SU4BfkhkhtnQuvqIQkKYuhd8TO68i/X8twTQk+Wĥj68G0fOto3DiH7+0dcVXx/DktFmWvA6VcuZE3rrbLh+RTAJhIG2uCoWC08yHYTO1CibzaFĦDEQWsQKiAE4ah/Vbf4kdVqV4Gs6D8Oncj7LGu8nurVD0YqZj02bpH6cXD5bKsrV1pV5u0fħPcQGPTl5HTz1bK0ANFxUJ2PGhW/V2mT/HJuxDlUXcTLANQ8ljFWTk44QcAh3xCBqHjwEt4ĨxTKkIxlkHQAAA9CsiPUKrIj1CgAAAAdzc2gtcnNhAAABAQDbvRN/gvQBhFe+dE8p3Q865Tĩ/xTKgjqTjj56p1IIKbq8SDyOybE8ia0rMPcBLAKds+wjePIYpTtRxT9UsUbZJTgF+SGSG2ġ0dC6+ohCQpi6F3xM7ryL9f圓BNCT5aPrwbR862jcOIfv7R1xVfH8OS0WZa8DpVy5kTeutsuġ1H5FMAmEgba4KhYLTzIdhM7UKJvNoUMRBaxAqIAThqH9Vt/iR1WpXgazoPw6dyPssa7ye6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MTUtRzIBĪlright now we have the public key and the private key with us, let us create our terraform configuration file using the public key. We are going to use public key aws_key.pub inside the terraform file to provision/start the ec2 instance. If you remember in the previous step we have generated the keys at path /home/rahul/Jhooq/keys/aws we should see two key files over there. But let us take a look at the keys and how it looks. In the previous step, we have generated the key-pair which we are going to use for provisioning the EC2 instance. 2Enter file in which to save the key (/home/rahul/.ssh/id_rsa): /home/rahul/Jhooq/keys/aws/aws_keyģEnter passphrase (empty for no passphrase):ĥYour identification has been saved in /home/rahul/Jhooq/keys/aws/aws_keyĦYour public key has been saved in /home/rahul/Jhooq/keys/aws/aws_key.pubĨSHA256:sAOjXyvJc2gnMrvxXA+qiaU9pUEvwl5ZG9Y2kZqRf5M key's randomart image is:ġ.2 Verify the generated public key and private key
