Generating a new SSH key

Before you can connect to your site via SFTP you must create a new SSH keypair. If you already have a keypair, you can also import the public key. An SSH keypair consists of a private and a public key. The private key, usually password protected, is kept on your own computer. You should not share this private key with anyone.

The public key can be provided to any service that you need to connect to. During the authentication process, the keys are matched and access is allowed if the keys are accepted. You can add and authorize multiple keys to your account. For example, you can add a key for yourself, a key for a service like VaultPress, and a key for a developer if you have one working on your files.

To generate a new keypair, first log in to cPanel: https://wpopt.net/knowledgebase?action=displayarticle&id=9

1) Scroll down to the section "Security" and click on "SSH Access".



2) On the next page, click on "Manage SSH Keys"



3) Click on "Generate a New Key".



4) On the next page, enter a name for the key (optional, must not have spaces) and a password for the key. You will need to enter this password every time you use the private key to authenticate against the public key, then click on "Generate Key"



5) Your key generation is now complete. You will now need to download the private key to your home computer. To do this, head on back to the key management section. You can view and download both keys if you wish. You can download either key download by clicking on the "View/Download" button. If you wish, you may then delete it from within your cPanel interface. Once you have a copy of your private key then you're almost ready.



6) By default, when you add a public key, it is not authorized for use. You must authorize the key by clicking on "Manage" next to the key in the key management section. After this, you can then click on "Authorize", as shown below.



7) The state of the public key will then change to "Authorized" and can then be used in conjunction with your private key for connections to your hosting.

  • SSH, key, generation, keypair
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to connect to your site via SFTP

Your hosting supports file transfer connections via FTP, FTPS (FTPES), and SFTP. For security...

Importing an SSH key

Before you can connect to your site via SFTP you must import or setup a new SSH keypair. If you...