Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Connecting to the Virtual Machine using SSH
lock
Launch Jenkins and SonarQube Docker Containers
lock
Login to SonarQube and Generate Security Token
lock
Log in to Jenkins and Complete the Default Installation
lock
Install and Configure SonarQube and Gradle Plugins
lock
Create and Execute Jenkins Pipeline Gradle Job
lock
Review SonarQube Static Analysis Report
lock
Validate AWS Lab
live-help Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

In this Lab Step, you will employ a Secure Shell (SSH) client to connect to a remote Linux server. SSH is a cryptographic network protocol for securing data communication. SSH establishes a secure channel over an unsecured network. Common applications include remote login and remote command execution.

Note: If you are connecting to an instance automatically created by the Cloud Academy Lab environment, it can take a few minutes to appear. If the instance is not visible, please refresh after a minute or two until it appears.

 

Instructions

Downloading the appropriate key pair

If you are using Linux or macOS, download the Privacy-enhanced Electronic Mail (PEM) key pair automatically generated by the Cloud Academy platform. If you are using Windows, download the PuTTY Private Key (PPK) key pair. Both the PEM and PPK are available in the Credentials section in the upper-left corner of this Lab.

Note: Cloud Academy enterprise accounts also provide an enterprise bridge feature that allows you to bypass corporate network and software installation policies that may otherwise prevent you from completing this lab step.

 

Locating the virtual machine IP address

1. In the AWS Management Console, click Services, enter EC2, and click the EC2 result:

alt

 

2. In the left-hand menu, click Instances:

alt

The Instances list page will load.

 

3. Select the target virtual machine and look for the Public IPv4 address field:

alt

The IP address is displayed in the Details tab and as a column in the Instances list.

 

4. To copy the Public IPv4 address, next to the IP address, click the copy icon:

alt

The public IP address of the instance has been copied to your clipboard.

Note: If you are connecting to an instance automatically created by the Cloud Academy Lab environment, it can take a few minutes to appear. If the instance is not visible, please refresh every minute or two until it appears.

 

5. Paste the IP address somewhere you can easily retrieve it.

In a moment you will use it to connect to the instance.

CloudAcademy recommends using a draft email to temporarily store notes during a lab.

 

Connecting using Linux/macOS

Linux distributions and macOS include a SSH client that accepts standard PEM keys. Complete the following steps to connect using the included terminal applications:

a. Open your terminal application. If you need assistance finding the terminal application, search for terminal using your operating system's application finder or search commands.

 

b. Enter the following command and press Enter:

content-copyCopy code
ssh -i /Path/To/Your/KeyPair.pem AMIUserName@YourIPv4Address

where the command details are:

ssh initiates the SSH connection

-i specifies the identity file

/Path/To/Your/Keypair.pem specifies the location and name of your key pair. An example location might be /Home/YourUserName/Downloads/KeyPair.pem.

AMIUserName specifies the SSH user:

For the Amazon Linux Amazon Machine Image (AMI), a standard SSH user is ec2-user.
For Ubuntu images, a standard SSH user is ubuntu
For CentOS images, a standard SSH user is centos
For Debian images, a standard SSH user is admin.
For Red Hat 6.4 and later images, a standard SSH user is ec2-user.

YourIPv4Address is the IPv4 address noted earlier in the instructions.

Note: Your SSH client may refuse to start the connection due to key permissions. If you receive a warning that the key pair file is unprotected, you must change the permissions. Enter the following command and try the connection command again:

content-copyCopy code
chmod 600 /Path/To/Your/KeyPair.pem

 

c.  After successfully connecting to the virtual machine, you should reach a terminal prompt similar to the one shown in the image below.

Note: If you receive a warning that the host is unknown, enter y or yes to add the host and complete the connection.

alt

 

Connecting using Windows

Windows does not include an SSH client; you must download an application that includes one. A free, and useful utility, is called PuTTY. PuTTY supports SSH connections, as well as key generation and conversion. Download PuTTY at http://www.putty.org. Complete the following steps to use PuTTY to create an SSH connection.

a. Open PuTTY and insert the IPv4 public IP address in the Host Name (or IP address) field.
alt

 

b. Navigate to the Connection > SSH > Auth section. Select the PPK key pair you downloaded earlier, and click Open.
alt

 

c. Wait several seconds for the authentication prompt. Enter the SSH username for the virtual machine operating system, such as ec2-user for Amazon Linux, and press Enter.

Additional example SSH usernames include:

For Amazon Linux, a standard SSH user is ec2-user.
For Ubuntu images, a standard SSH user is ubuntu.
For CentOS images, a standard SSH user is centos.
For Debian images, a standard SSH user is admin.
For Red Hat 6.4 and later images, a standard SSH user is ec2-user.

 

Summary

In this Lab Step, you connected to a virtual machine using an SSH client.