Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Configuring Build Agents in Jenkins

In this hands-on lab, we will create build agent accounts on our remote agents that will then be used to connect those to the Jenkins server to allow us to build remote jobs in a more secure way. We will use specific accounts for the build agents that are not used by normal users and are accessed by the Jenkins server via SSH keys. This can be done as part of a more secure strategy for deploying build agents, and it also allows for better Audit Trail management.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 45m
Published
Clock icon Aug 28, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Log In to the Jenkins Master, and Set Up Keys for the `cloud_user` on the Agent Server

    1. Log in to the Jenkins server via SSH using the cloud_user credentials provided.
    2. From the Jenkins server, access the agent as the jagent user via SSH.
    3. Ensure jagent's home directory is in /var/lib, and then exit the agent machine.
    4. On the Jenkins server as cloud_user, generate SSH keys using all defaults (no passphrase).
    5. Copy the keys from cloud_user on the Jenkins server to jagent on the agent server.
    6. Verify you are able to log in to the agent server as jagent without a password.
  2. Challenge

    Copy the `.ssh` Information from `cloud_user` to the `jenkins` User

    1. Log in to the Jenkins server via SSH using the cloud_user credentials provided.
    2. Verify there is not an .ssh directory in the jenkins user's home directory.
    3. Using sudo, copy the contents of the .ssh directory from /home/cloud_user/.ssh to /var/lib/jenkins/.ssh.
    4. Verify the necessary items are located in the /var/lib.jenkins/.ssh directory and the permissions are correct.
    5. Correct the permissions on the /var/lib/jenkins/.ssh directory so jenkins is the owner.
  3. Challenge

    Configure the Agent in the Jenkins GUI

    1. Copy the contents of /var/lib/jenkins/.ssh/id_rsa.
    2. Log in to the Jenkins GUI using the credentials provided on the lab page.
    3. Navigate to Manage Jenkins > Manage Nodes and Clouds > New Node.
    4. The agent should be named Ubuntu_Agent, and select Permanent Agent.
    5. Configure the agent with four executors, and set the IP address as the hostname.
    6. Add the credentials as SSH with private key.
    7. Complete the configuration using the parameters provided.
    8. Verify the agent comes online.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans