Guides/Plugins and tools/Tools/Generate an SSH key

Generate an SSH key

Last reviewed on November 6, 2025

The instructions in this guide will show you how to generate an SSH key pair, add the public SSH key to your WordPress.com account, and then attaching the public SSH key to any sites you’d like to use it with.

This section of the guide applies to sites with the WordPress.com Business and Commerce plan. If you have a Business plan, make sure to activate it. For free sites and sites on the Personal and Premium plans, upgrade your plan to access this feature.

About SSH keys

SSH keys are a more secure way to connect via SSH. An SSH key pair comprises a private and public key. The public key is configured on the server, and the private key remains on the local computer. Once configured, SSH keys do not require you to enter a password every time you connect, as the key pair handles authentication. If the private key on the local computer matches the public key configured on the server, the user can connect.

You can add one public key per WordPress.com account, which you can then attach to multiple sites. Each site can have multiple keys attached, one per privileged user.

If you don’t have an SSH key pair on your computer, connecting to SSH via password authentication also works.

Generate an SSH key

You can generate SSH key pairs on Mac, Windows, and Linux. Once you create your key pairs, you can then add your public key to your WordPress.com account.

Create an SSH key on macOS and Linux

To generate an SSH key pair using macOS, take the following steps:

  1. Open the Terminal.
  2. Run the command ssh-keygen -t ed25519.
  3. When prompted, enter the name of the file where you wish to store your key or press Enter to accept the default file name. On MacOS or Linux systems, the default location is the .ssh directory in your home directory.
  4. When prompted, type a secure passphrase to use with your key.

This will save a public and a private key in the chosen location. The public key, which you’ll need for your WordPress.com account in the next step, will include the .pub extension.

Create an SSH key on Windows

To generate an SSH key using Windows, take the following steps:

  1. Open PowerShell or cmd prompt.
  2. Run the command ssh-keygen -t ed25519.
  3. When prompted, enter the name of the file where you wish to store your key or press Enter to accept the default file name.
  4. When prompted, type a secure passphrase to use with your key.

This will save a public and a private key in the chosen location. The public key, which you’ll need for your WordPress.com account in the next step, will include the .pub extension.

Add an SSH key to your account

Before adding your SSH key to your WordPress.com account, you need to copy it to your clipboard. There are two ways to do this using your computer terminal:

macOS

pbcopy < ~/.ssh/id_rsa.pub

Windows

clip < ~/.ssh/id_rsa.pub

Linux

cat ~/.ssh/id_rsa.pub

If your SSH public key file uses a different name than the one mentioned above, edit the code to match the filename on your computer.

After copying your public SSH key to your clipboard, you will be able to add it to your account by following these steps:

  1. Visit your WordPress.com profile: https://wordpress.com/me
  2. On the sidebar, click on Security.
  3. Click on the “SSH Key” option available in the security checklist.
  4. Paste your SSH key into the “SSH public key” field.
  5. Click on the “Save SSH Key” button.
An example of an SSH key is pasted into the box.

Once you add your SSH key to your WordPress.com account, you should follow the steps in the next section of this guide to attach it to each site you’d like to use it on.

Attach an SSH key to a site

After adding an SSH key to your account, it will be necessary to attach it to the site you want to connect via SSH. To attach your SSH key to a site, follow these steps:

  1. Visit your Sites page: https://wordpress.com/sites/
  2. Click the ⋮ next to your site and select Settings.
  3. Scroll down and click SFTP/SSH.
  4. Use the SSH Keys dropdown to select the desired key:
The SSH panel in the site Settings dashboard on WordPress.com.
  1. Click on the Attach SSH Key to Site button.

Once your SSH key is attached to the site, you can use the SSH key when authenticating over SSH.

Detach a key from a site

If you no longer want to connect to a site using your SSH key, you can detach the key from the site by following these instructions:

  1. Visit your Sites page: https://wordpress.com/sites/
  2. Click the ⋮ next to your site and select Settings.
  3. Scroll down and click SFTP/SSH.
  4. Under the SSH section, locate the SSH key you want to remove.
  5. Click on the Detach button to remove the key from the site.

The SSH key will still be associated with your WordPress.com account until you remove it.

Update an existing SSH key

Follow the below steps to update your public SSH key:

  1. Visit your WordPress.com profile: https://wordpress.com/me
  2. On the sidebar, click on Security.
  3. Click on the “SSH Key” option available in the security checklist.
  4. Click on the “Update SSH key” button next to the key you wish to update.
  5. Paste your updated SSH key to the “New SSH Public Key” field.
  6. Click the “Update SSH Key” button to save the change.

Remove an existing SSH key

Removing an SSH key from your WordPress.com account will also detach it from each site it’s associated with. To remove an existing SSH Key from your WordPress.com account, follow these steps:

  1. Visit your WordPress.com profile: https://wordpress.com/me
  2. On the sidebar, click on Security.
  3. Click on the “SSH Key” option available in the security checklist.
  4. Click on the “Remove SSH Key” button displayed beside the existing key.
  5. A confirmation message will be displayed. Click the OK button to confirm that you want to remove the key.

Was this guide helpful for you?

Not quite what you're looking for? Get Help!

Copied to clipboard!