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

Configure SSH for HashiCorp Vault Authentication

In this hands-on lab, you will be required to configure a HashiCorp Vault to generate SSH one-time passwords for a client on request. In order to achieve this, we will need to configure both the SSH Client, and the HashiCorp Vault servers.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 2h 0m
Clock icon Oct 23, 2020

Contact sales

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

Table of Contents

  1. Challenge

    Unseal the Vault and Log in with the Root Token

    1. Retrieve the vault keys.
    2. Unseal the vault.
    3. Log in with the Initial Root Token.
  2. Challenge

    Enable SSH Secrets Engine and Provide Access to `ssh/creds/otp_role`

    1. Enable SSH Secrets engine.
    2. Create an otp_role with key type otp.
    3. Create a policy file to provide access to ssh/creds/otp_role.
    4. Write a policy based on the otp-policy.hcl file.
  3. Challenge

    Enable the `userpass` Authentication Method

    1. Enable userpass.
    2. Create a user and assign the otp-policy.
  4. Challenge

    Install `vault-ssh-helper` and Configure SSH

    1. On the SSH Client server, download vault-ssh-helper.
    2. Add the ubuntu user.
    3. Unzip the file and move it to /usr/local/bin.
    4. Update the permissions on the vault-ssh-helper binary.
    5. Change ownership of the binary from the cloud_user, to the root user, and root group.
    6. Create a new directory named vault-ssh-helper.
    7. Create a configuration file for vault-ssh-helper.
    8. Modify the pam.d/sshd configuration file.
    9. Modify the sshd configuration file.
    10. Restart sshd to apply the changes.
    11. Run vault-ssh-helper verification.
  5. Challenge

    Log in with the `userpass` Credentials, and Generate the One-Time Password

    1. On the Vault server, log in with the userpass credentials.
    2. Create a one-time password and copy the key for later use.
    3. From the Client server, use the one-time password to connect to the SSH Client server.

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