{"id":7505,"date":"2018-06-01T22:45:49","date_gmt":"2018-06-01T14:45:49","guid":{"rendered":"http:\/\/rmohan.com\/?p=7505"},"modified":"2018-06-01T22:45:49","modified_gmt":"2018-06-01T14:45:49","slug":"ec2-instance-aws","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7505","title":{"rendered":"EC2 instance aws"},"content":{"rendered":"<pre>Launch a Linux Virtual Machine\r\n===============================\r\nStep 1: Launch an Amazon EC2 Instance\r\nEC2 console &gt; launch instance\r\n\r\nStep 2: Configure your Instance\r\na. Amazon Linux AMI\r\nb. t2.micro &gt; default options\r\nc. review and launch \r\nd. create new key pair &gt; \"MyKeyPair\" &gt; Download key pair\r\nWindows users: We recommend saving your key pair in your user directory in a sub-directory called .ssh (ex. C:\\user\\{yourusername}\\.ssh\\MyKeyPair.pem).\r\nMac\/Linux users: We recommend saving your key pair in the .ssh sub-directory from your home directory (ex. ~\/.ssh\/MyKeyPair.pem).\r\nNote: On Mac, the key pair is downloaded to your Downloads directory by default. \r\nTo move the key pair into the .ssh sub-directory, enter the following command in a terminal window: mv ~\/Downloads\/MyKeyPair.pem ~\/.ssh\/MyKeyPair.pem\r\n\r\nclick Launch instance\r\n\r\ne. EC2 &gt; View instances\r\nf. make note of public ip address of the new instance\r\n\r\nStep 3: Connect to your Instance\r\nWindows users:  Select Windows below to see instructions for installing Git Bash.\r\nMac\/Linux user: Select Mac \/ Linux below to see instructions for opening a terminal window.\r\n\r\na. instructions to install git bash\r\nb. open git bash to run ssh command\r\nc. connect to your instance\r\n\r\nWindows users: Enter ssh -i 'c:\\Users\\yourusername\\.ssh\\MyKeyPair.pem' ec2-user@{IP_Address} (ex. ssh -i 'c:\\Users\\adamglic\\.ssh\\MyKeyPair.pem' ec2-user@52.27.212.125)\r\nMac\/Linux users: Enter ssh -i ~\/.ssh\/MyKeyPair.pem ec2-user@{IP_Address} (ex. ssh -i ~\/.ssh\/MyKeyPair.pem ec2-user@52.27.212.125)\r\n\r\nNote: if you started a Linux instance that isn't Amazon Linux, there may by a different user name that is used. \r\ncommon user names include ec2-user, root, ubuntu, and fedora. \r\nIf you are unsure what the login user name is, check with your AMI provider.\r\n\r\nYou'll see a response similar to the following:\r\n\r\nThe authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (10.254.142.33)' can't be established. \r\nRSA key fingerprint is 1f:51:ae:28:df:63:e9:d8:cf:38:5d:87:2d:7b:b8:ca:9f:f5:b1:6f. \r\nAre you sure you want to continue connecting (yes\/no)?\r\n\r\nType yes and press enter.\r\n\r\nYou'll see a response similar to the following:\r\n\r\nWarning: Permanently added 'ec2-198-51-100-1.compute-1.amazonaws.com' (RSA) to the list of known hosts.\r\n\r\nYou should then see the welcome screen for your instance and you are now connected to your AWS Linux virtual machine in the cloud.\r\n\r\n\r\nStep 4: Terminate Your Instance\r\na. EC2 console &gt; instance &gt; actions &gt; Instance state &gt; Terminate\r\nb. confirm yes to terminate\r\n\r\n\r\nLaunch a Windows Virtual Machine\r\n================================\r\nStep 1: Enter the EC2 Dashboard\r\nEC2 &gt; console\r\n\r\nStep 2: Create and Configure Your Virtual Machine\r\na. launch instance\r\nb. Microsoft Windows Server 2012 R2 Base &gt; select \r\nc. instance type &gt; t2.micro &gt; Review and launch\r\nd. default options &gt; launch\r\n\r\nStep 3: Create a Key Pair and Launch Your Instance\r\na. popover &gt; select \"create a new key pair\" &gt; name: \"MyKeyPair\" &gt; Download key pair &gt; MyFirstKey.pem\r\n\r\nWindows users: We recommend saving your key pair in your user directory in a sub-directory called .ssh (ex.C:\\user\\{yourusername}\\.ssh\\MyFirstKey.pem).\r\nMac\/Linux users: We recommend saving your key pair in the .ssh sub-directory from your home directory (ex.~\/.ssh\/MyFirstKey.pem). \r\n\r\nb. Launch instance\r\nc. on the next screen \"View instances\" &gt; status\r\n\r\nStep 4: Connect to Your Instance\r\nconnect using RDP\r\n\r\na. select instance &gt; connect\r\nb. login\r\nThe User name defaults to Administrator\r\nTo receive your password, click Get Password\r\nc. choose MyFirstKey.pem &gt; Decrypt password\r\nd. save decrypted password in a safe location\r\n\r\nStep 6: Connect to Your Instance\r\nRDP client\r\na. Click download remote desktop file\r\nb. enter username and password\r\nyou should be logged in!!\r\n\r\nStep 7: Terminate Your Windows VM\r\na. EC2 Consolle &gt; select instance &gt; actions &gt; Instance state &gt; Terminate\r\nb. confirm yes to terminate\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Launch a Linux Virtual Machine =============================== Step 1: Launch an Amazon EC2 Instance EC2 console &gt; launch instance Step 2: Configure your Instance a. Amazon Linux AMI b. t2.micro &gt; default options c. review and launch d. create new key pair &gt; &#8220;MyKeyPair&#8221; &gt; Download key pair Windows users: We recommend saving your key pair [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7505"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7505"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7505\/revisions"}],"predecessor-version":[{"id":7506,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7505\/revisions\/7506"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}