Managed WooCommerce Stores Help

Generate an SSH key pair on Windows

Keeping your online store safe and secure is our top priority. To maintain security of credentials and site as a whole, an SSH key pair is required for accessing your site over SFTP. In this article, we'll show you how to generate an SSH key pair on Windows.

Check for existing SSH key pairs

  1. Open up a new command prompt.
  2. Enter the following command to check for any existing files within your .ssh directory:
    dir .ssh
    
  3. If you see any files ending in .pub (typically id_rsa.pub), you already have an existing SSH key pair. If you want to continue using this existing key pair, you're free to skip the next section and head on over to grabbing the contents of your public key.

    If you'd prefer to use a different key pair, the next section will show you how to generate one.

Generate an SSH key pair

Ready to generate a new SSH key? Awesome! Let's get started:

  1. Start by opening a new Command Prompt window or if you followed the previous section, you can use the one that's already open.
  2. Next, issue the following command to generate a new SSH key pair:
    ssh-keygen -t rsa
    
  3. After entering the ssh-keygen command, you'll be asked where you want to save your key pair.

    Unless you have a specific reason for storing your SSH key elsewhere, such as if you already have an existing key pair that you want to keep, the default path and id_rsa filename will be fine. Just leave the prompt blank and press the Enter key to use the default location.

  4. Lastly, you'll be prompted to secure your SSH keys with a password. While this step is optional, we highly recommend setting a passphrase as a security best practice.

Your SSH key pair has now been generated! This includes a public key that will be named id_rsa.pub and your private key labeled id_rsa. Since this private key controls access to your account, be sure to keep your private key as safe as you would a password.

Get your SSH public key

After your key pair has been generated, you'll need to access your public key. Here's how to do it.

  1. Open a new Command Prompt window or use an existing open window.
  2. Enter the following command to output the contents of your public key:
    Note: The following command assumes that your key pair is named id_rsa as described in previous steps. If you're using a key with a different name, you'll need to adjust the command accordingly.
    type .ssh/id_rsa.pub
    

With an SSH key pair in hand, you're almost ready to connect to your site over SFTP. Next, you'll need to associate the public key with your Managed WooCommerce Stores account. To learn more about adding it, see our article on adding public keys to your Managed WooCommerce Stores account.

More info

Share this article