In our last post, we learned how to create EC2 instance in AWS. After successfully launching our EC2 Linux instance, today we will connect to our instance so we can install and run WordPress. There are two methods via which we can connect to our Amazon EC2 Linux instance:
- A standalone SSH Client
- A Java SSH client directly from my browser (Java required)
Later seems easy to connect as most of the computer have java installed, let's get started and see how to connect our EC2 instance directly from browser.
First check whether you have java installed or your browser supports java or not?
All of you have encountered with error/problem while connecting to your instance in Chrome browser as the Chrome browser version 42 and above disabled the standard way their browser supports plugin.
Now it’s Firefox turn: While trying on Mozilla Firefox 64-bit, I got a message saying it is 64-bit and will not run java. Another failed attempt.
Our Last hope?: Using Microsoft Edge browser didn’t help either as it doesn’t have support plugin. My bad!
Old is Gold!? While checking for java on internet explorer (IE11), a pop-up window appeared mentioning “the page you are viewing uses java”. Finally a positive response, now it’s time to connect our instance by
- Sign-in to AWS console –> EC2 dashboard-> running instance-> select running instance –> click on Connect button
- Select “A Java SSH client directly from my browser (Java required)”
- Your username will be mentioned by default as “ec2-user”. Now enter the location of private key path (which you have downloaded in step 7 of creating ec2 instance) C:\folder\location\private_key.pem and select save key location
- Now click on “Launch SSH client” button .
Wait! Nothing happened, the same pop-up appeared and didn’t connect. Looks like IE 11 on 64bit Windows 10 won’t work.
This time around installing and running on 32-bit Firefox, I have had encountered with a different message (gladly) but – Limited support for the plugin, therefore will not run java. There are other browser options like opera, safari which I didn’t try and leaving up to you to try it using above steps and leave a comment below whether they worked for you or not.
It’s time to go with the first option of connecting instance via standalone SSH client:
Connect to Amazon EC2 Linux Instance using PuTTY
For Windows user
- Download PuTTY, PuTTYgen
- Open PuTTYgen –> click “Load” button –> Windows explorer will open browse to the .pem file location (private key that you have downloaded while creating EC2 instance) and select “All Files (*.*)” otherwise you won’t be able to see your .pem –> click “open”
- Select “save private key”. PuTTYgen warning window appear to ask you to save this key without a passphrase key? If you want to then you may choose otherwise it’s not necessary. In short press “yes” and save the .ppk file.
- In Category pane, expand connection, then expand SSH, click on Auth –> Browse your .ppk and click Open.
- If you connect for the first time, PuTTY display security alert –> choose “Yes”.
For Mac OSX/Linux User:
- Open Terminal
- Locate your private key (.pem) key. (In my case, private key is in download folder)
- Your key must not be publicly viewable for SSH to work. Use this command:
chmod 400 your_privatekey.pem
chmod 400 /location/private_key.pem
- Now connect to your instance using below command:
ssh -i "your_privatekey_name.pem" [email protected] You will see message like this:
The authenticity of host xxx:xxx:xx:xx:xx can't be established.
RSA key fingerprint is xx:xx:xx:xx:x:xx:xx:xx:xx:xx:xx:xx:xx:xx
Are you sure you want to continue connecting (yes/no)?
- Type Yes and enter
- Now you are successfully connected your EC2 Linux instance using Terminal.
On next, we will see how to install WordPress in AWS.