Set up SSH keys for a server

You can set up SSH keys for your Bare Metal Solution server.

It's optional to set up SSH keys. You can set them while provisioning a new server or while reimaging an existing one.

This feature is available only for the Linux OSes supported by Bare Metal Solution.

Before you begin

  1. Create SSH keys.

    Before initiating the server provisioning process, you must have the SSH keys. The public SSH keys that you provide are used as the authorized keys to log in to your Bare Metal Solution server.

    You must create the Cloud KMS key in the same project that contains your Bare Metal Solution server.

    If you choose to use SSH keys, you need at least one public SSH key. The public key must have an ssh-rsa type signature:

    ssh-rsa public_key optional comment
    

    To learn how to create SSH keys, see Create SSH keys.

    To learn how to manage your SSH keys, see Manage SSH keys.

  2. In the project that contains your Bare Metal Solution server, register your SSH keys. Follow the steps in Register the SSH keys.

Set up SSH keys while provisioning a server

You can set up SSH keys for a new Bare Metal Solution server while provisioning it through the Google Cloud console intake form.

You can only select the SSH keys that exist in the same project as that of your server.

To set up SSH keys while provisioning a server, see Use the Google Cloud console intake form to enter your selections.

Set up SSH keys while reimaging a server

To set up SSH keys while reimaging a server, see Change the OS for a server.

View SSH keys of a server

To view SSH keys of a server, follow these steps:

Console

  1. Go to the Servers page.

    Go to Servers

  2. Click the server name.

    On the Server details page, view the SSH keys in SSH keys field.

gcloud

Use the gcloud alpha bms instances auth-info command:

gcloud alpha bms instances auth-info SERVER_NAME --project=PROJECT_ID --region=REGION

Replace the following:

  • SERVER_NAME: The name of the Bare Metal Solution server.
  • PROJECT_ID: The ID of the project.
  • REGION: The location of the Bare Metal Solution server.

Access a server using the SSH keys

SSH keys are associated with the customeradmin user. Therefore, while logging in through SSH, use customeradmin as the username.

To learn how to log in to your Bare Metal Solution server, see Logging in to a Bare Metal Solution server for the first time.

What's next