To manage the newly created virtual machine, connect to the server via SSH from the local computer where you downloaded the xxxkey.pem file. In the initial SSH session, you connect as the root user. Later, you can create other identities on the server for administration purposes and log in to the session with a different user name.
The syntax to use for your SSH connection is provided by the
option in the Amazon Web Services console.Continuing in the Amazon Web Services console, in the left pane under
, click , then select the check box next to the openSUSE Linux VM (the currently running AMI instance).From the
drop-down menu, select .The pop-up dialog box provides the syntax information you need to connect via SSH to your virtual machine.
The general syntax to SSH is:
ssh -i xxxkey.pem root@ec2-xxx-xxx-xxx-xxx-xx.xxxxxx-x.amazonaws.com
Use one of the following methods to connect via SSH to the virtual machine:
When you work with the key file (xxxkey.pem) on a Windows machine, you need to convert the key to use a file format that is compatible with the SSH connection method you plan to use.
This section describes how to use PuTTY software for the SSH connection. PuTTY cannot directly open PEM key files. You must convert the key file to PPK format. The setup is a one-time process. After you set up an SSH session in PuTTY, you can easily connect to the VM at any time.
In a Web browser, go to the PuTTY Download page.
Download the following software to your Windows machine:
Software |
File Name |
Description |
---|---|---|
PuTTY |
putty.exe |
A Telnet and SSH client |
PuTTYgen |
puttygen.exe |
An RSA and DSA key generation utility |
Pageant |
pageant.exe |
An SSH authentication agent for PuTTY |
Continue with Converting the PEM Key File to PPK Format.
Launch the PuTTYgen software by double-clicking the puttygen.exe file, or by right-clicking the file and selecting .
In the PuTTY Key Generator window, click xxxkey.pem file that you downloaded to your local computer in Section A.3, Already Have an Existing Amazon EC2 Account?.
, then select theAfter the key information is loaded, specify a key comment and passphrase.
The
and fields allow you to choose a passphrase for your key that is used to encrypt the key on the disk. Use a strong passphrase for a more secure solution. Do not forget your passphrase. There is no way to recover it.You must enter the passphrase when you use the key to connect via SSH to the virtual server. To avoid entering the passphrase each time you start an SSH session, you can set up the key and passphrase in Pageant, as described in Setting Up the Key File and Passphrase in the Pageant Authentication Agent.
Save the private key in .ppk format.
The converted key is saved as xxxkey.ppk. Ensure that you store the xxxkey.pem and xxxkey.ppk key files in a secure location on your local computer.
Continue with Setting Up the Key File and Passphrase in the Pageant Authentication Agent.
Pageant is an SSH authentication agent. It holds an authentication key in memory, already decoded, so that you can start SSH sessions often, without needing to type a passphrase each time. PuTTY automatically retrieves the decoded key from Pageant when you start your SSH session with the virtual machine. When you stop the Pageant from running, the decoded key is removed from memory.
Launch the Pageant software by double-clicking the pageant.exe file, or by right-clicking the file and selecting .
The Pageant authentication agent starts running and places an icon in the notification area.
In the notification area, right-click the
icon, then select .In the Select Private Key File dialog box, browse to locate and select the xxxkey.ppk file you created in Converting the PEM Key File to PPK Format, then click .
When you are prompted, specify the passphrase for the xxxkey.ppk file.
The key appears in the
.The Pageant authentication agent must be running when you connect to the virtual machine with a PuTTY SSH session in order for Pageant to provide decoded key information.
Continue with Configuring an SSH Session in PuTTY.
Launch the PuTTY software by right-clicking the putty.exe file, then selecting .
In the left pane, select
.In
, specify the Elastic IP address that you set up for the virtual machine.You can alternately use the public DNS name of the virtual machine. You can find the DNS name by looking at the virtual machine instance in the Amazon AWS Management Console.
In
, select .Set up the authentication settings:
In the left pane, select
> .In the left pane, select
> > .Under
, select . This is selected by default.In xxxkey.ppk file you converted in Converting the PEM Key File to PPK Format, then click .
, browse to locate and select theIn the left pane, select
.Under iSCSI_Target_VM), then click .
, specify a name for this connection (such asThe name appears in the list under
.Close PuTTY.
The PuTTY SSH session setup is complete. You can use PuTTY to connect to the virtual machine with your saved SSH session at any time.
Continue with Connecting via SSH with PuTTY.
After you have set up the SSH session in PuTTY, you can use PuTTY to run the authenticated SSH session at any time.
Launch the PuTTY software by double-clicking the putty.exe file, or by right-clicking the file, then selecting .
In the PuTTY window, double-click the saved SSH session for the virtual machine, or select the session and click
.If you are not running Pageant, you are prompted for the passphrase for the authentication key. Provide the passphrase to continue.
A Login dialog box pops up for your OpenSSH session.
When you are prompted, log in as the root user.
After you are successfully connected, you are presented with a terminal console prompt for the virtual machine.
Continue with Section A.9, Installing the iSCSI Target Software on the openSUSE Linux VM.
On the local machine, open a terminal console, then log in as the root user.
Go to the folder where you saved the xxxkey.pem file. At the terminal console prompt, enter
cd /path_to_key_file_folder
Connect via SSH to the virtual machine.
The general syntax to SSH is:
ssh -i xxxkey.pem root@ec2-xxx-xxx-xxx-xxx-xx.xxxxxx-x.amazonaws.com
Click
to connect to the virtual machine.Keep the console open and do not terminate the SSH session.
Continue with Section A.9, Installing the iSCSI Target Software on the openSUSE Linux VM.