Connecting to Your Instance from Windows or Linux/OSX Using PuTTY.
Note: This section is for Linux and Mac OSX users only. If you are running Windows but have not yet connected to your instance, go back to previous step. If you have already connected to your instance, skip ahead to next step.
- To connect to your EC2 instance, run the following commands in Terminal:
chmod 400 <path and name of pem>
ssh –i <path and name of pem> ec2-user@<public IP>
- For path and name of pem, substitute the path/filename to the .pem file you downloaded.
- For public IP, substitute the public IP address for your Web Server instance which you copied into a text editor earlier in the lab.
- Start PuTTYgen.exe, click Load. By default, PuTTYgen display only files with the extension .ppk. to locate your .pem file, select the option to display files of all types.
-
Select your .pem file (ex. amazonec2_keypair_virginia.pem), and then click Open. Click OK to dismiss the confirmation dialog box.
-
Click Save private key to save the key in the format that PuTTY can use. PuTTYgen displays a warning about saving the key without a passphrase, click Yes.
-
Specify the same name for the key that you used for the key pair (ex. amazonec2_keypair_virginia.ppk). PuTTY automatically adds the .ppk extension.
-
Start PuTTY.exe, enter Host Name, find hostname from AWS console. (select Lab Server, and copy the public IP value.).
- On the navigation pane, click Connect>SSH>Auth, click Browse to choose your key pair (ex.amazonec2_keypair_virginia.ppk), click Open.
- Enter ec2-user,and press ENTER.You are now logged into your Lab Server instance.