Adding a public key

An SSH public key is required to SSH to servers and environments of sites. You can also use your public key to access your servers using SFTP or rsync, or to access your Git repository.

Adding an SSH key to your Acquia account

You can add a public key to your Acquia account. If you have the proper role and permission as a member of a team, you can then use your public key to SSH to servers and environments of sites your team is assigned to. You can also use your public key to access your servers using SFTP or rsync, or to access your Git repository.

After you have added your SSH public key to your account, you can use it to access an Acquia Cloud server or environment, if:

  • You are a member of a team that is assigned to the server's site, and you have a role that includes the appropriate SSH permissions, or
  • You are either be a primary or technical contact for the site.

Acquia provides the following permissions related to SSH keys:

  • Add SSH key to Git repository
  • Add SSH key to non-Production environments
  • Add SSH key to the Production environment

So, if you have just the Add SSH key to git repository and Add SSH key to non-Production environments permissions, you can check code into and out of your site's Git repository, as well as use SSH to connect to your site's Dev and Stage environments, but you cannot connect to your site's Production environment using SSH. Learn more about teams and permissions.

To add a public key to your account:

  1. Click your name in the upper right of the Acquia user interface, then click View profile to open your Acquia profile.

    Edit Profile

    Or, just click here.
  2. In your Acquia profile, click Credentials.
  3. On the Credentials page, under SSH keys, click Add SSH key.
  4. Enter the SSH key nickname, such as the name of the person who owns the key.

    Add SSH Key

  5. Entering the key

  6. Using a text editor, open your SSH public key file, and then copy the contents of the file to the clipboard, ensuring that you don't add any extra lines or spaces to the copied key.

    By default, the file name is ~/.ssh/id_dsa.pub or ~/.ssh/id_rsa.pub.

    If you can't either view or edit the public key file

    If you can't either view or edit your public key file using a text editor, use a command like one of the following to copy the contents of the key file directly to the clipboard:

    • Mac

      pbcopy < ~/.ssh/id_dsa.pub

    • Linux

      sudo apt-get install xclip
      xclip -sel clip < ~/.ssh/id_dsa.pub

    • Windows with GitBash

      clip < ~/.ssh/id_dsa.pub

  7. Paste the OpenSSH-formatted key into the SSH public key field. OpenSSH public keys start with ssh-dss or ssh-rsa, and appear similar to the following example:

    ssh-dss  AAAAG1bB0us3MAAACBALFF6+dpSkO6bwbJ6BCCwbGavQPqR3JSwGWWm1ZCg2
    i43xzDTonY6+PZavGYbgbYgGySDVBbSxKIKSMGUWE8EVHiYzwiUYYaFdTYpkEyqOw/6FlDN
    sVjL+hb454dPgdYOhvjVCI683KrvTP6OMmQTCxInQpeYmyYql7dhhbg4B7AAAAFQDjLv0eP
    hqNrlPyX6j76nxF0dAf3wAAAIB4boChX4eU8YQT0Og023q44f0dlTvJFgKHa6UZDVUBDpw9
    ZsVvkk703HBjFPxDaOJPjurZtMuGIkw8XhA4a8gWj5v9WppY8EQZcmxHoI73czcCJ53WfRr
    qOwM3HHZddoxEcwz0sTdQ3BkG7G1z0ln92raOnFPC0Ju7YCCV82yswAAAIBjGPas8fU7ycf
    T0dMwtQmUetcj+5qUam7imzwNZ9EB29JVLbo90oVSjWJHrGMst2tGEw3VQm+a1o/ICq+nSG
    I9/trLbbEoTISO8MnDi/5UEiPApo4636EKkIahE8QKZlhlqtGZPfp0hDmn1vgKgFkp95em+
    Zb6r1IZJmx+/ORjcg== user@hostname

  8. Click Add key.

After you add a key, there can be a delay of approximately a minute before you can use the key to connect to your servers or repository.

About per-site SSH keys

Some Acquia Cloud websites may also have site-wide SSH public keys. Using per-user SSH public keys is recommended and site-wide SSH public keys can no longer be added to Acquia Cloud sites. Once deleted, site-wide SSH public keys cannot be restored.

Related topics