View Single Post
Old 2016-07-15, 05:01   #10
GP2
 
GP2's Avatar
 
Sep 2003

5×11×47 Posts
Default Setting up an EFS filesystem: run the ssh client program

This part will need to be done separately for each AWS region that you use (but for now let's just do one region).

In the previous section, you launched an instance. You made sure that it had the correct IAM role (IAM instance role).

In this section, you will log into that instance with an ssh client program.

Go to the EC2 console at http://console.aws.amazon.com/ec2/, then click on the "Instances" link in the left-hand-side menu.

Make sure you are in the same AWS region where you created the EFS filesystem in the previous steps, and change it if necessary. The region name is indicated at the top right part of the page.

Click on the instance that was identified or created in the previous section. This will bring up the information for that instance in the bottom half of the page.

In the bottom half of the page, verify once again that the "IAM role" field says mprime-instance-role or whatever you named it in the "Make sure your IAM instance role exists and it has the right permissions" section earlier. If not, start over with some other instance (go back to the previous section).

Also in the bottom half of the page, verify the "Key pair name" field. This is the key pair name that your ssh client program will use, presumably it is the same key pair name from the "Make sure that you have a key pair for ssh logins" section earlier.

Finally, and once again in the bottom half of the page, locate the "Public DNS" field, which will contain an entry similar to "ec2-nnn-nnn-nnn-nnn.REGION-NAME-HERE.compute.amazonaws.com", where each of the "nnn" parts of the "nnn-nnn-nnn-nnn" are numbers from 1 to 255, and together they are the representation of an IP address, and REGION-NAME-HERE is the name of the AWS region (e.g., us-east-1 for N. Virginia, us-west-2 for Oregon, etc). Make note of this, this is the host name that your ssh client program will use.

Run your ssh client program, providing it with both the "Key pair name" and the "Public DNS" information mentioned above. If you use PuTTY for Windows, some basic information on how to use it is provided at the bottom of this section.

You should now have a terminal window asking you to log in. It should say "login as:"

Note: if you get a "network error" instead, perhaps you just launched the instance a minute ago and it is not yet ready to accept network connections. Wait a minute and try again.

If you do not get a "login as:" prompt, and the terminal window simply times out, then perhaps your IP address has changed from what it was when you set it in the "Configure ssh for the default security group" section earlier. If so, go back to that section and redo the "My IP" setting, then try again.

At the "login as:" prompt, enter ec2-user (note you cannot log in as "root").

If you chose not to create a passphrase in a previous section, you will now get a shell prompt for the Linux bash shell.

If you did choose to create a passphrase in a previous section, you will now be asked for it. You will then see:

Code:
login as:
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Enter the passphrase you (optionally) created in the Make sure that you have a key pair for ssh logins section above. You will then get a Linux shell prompt, and are ready to enter Linux commands.


PuTTY

( Note: as an alternative to using PuTTY, you could use the ssh command in Windows Subsystem for Linux. )

( PuTTY can be downloaded at http://www.chiark.greenend.org.uk/~sgtatham/putty/ )

If you are using PuTTY on Windows as your ssh client, start the program. In the dialog box, go to the "Host Name (or IP address)" field and enter the "ec2-" string mentioned above, which comes from the "Public DNS" information for the instance.

Then in the "Category" area on the left part of the dialog box, click on Connection --- SSH --- Auth (click on the "+" to expand "SSH" if necessary). , then in the "Private key file for authentication" text input box, click the "Browse..." button and select the key pair .ppk file that was mentioned (or created) in the "Make sure that you have a key pair for SSH logins" section. Click on the "Open" button, and then in the original dialog box, click on the "Open" button there too.

You will probably get a warning box with a big yellow exclamation mark that says "The server's host key is not cached in the registry." and a bunch of other text. This is normal, click on "Yes".

A terminal window will open. For the rest, continue as described above, in the main part of this section.


Next section: Setting up an EFS filesystem: initial setup and configuration

Last fiddled with by GP2 on 2017-07-30 at 16:46
GP2 is offline   Reply With Quote