written by
Rich Martinez

Creating a SSH Key for Cloudways

3 min read

One of the most secure way of accessing a remote server is using a SSH Key. SSH stands for Secure Shell. It requires multiple steps so here are the 3 tools you will need:

3 Tools You'll Need to Get Started

  1. Terminal (standard on a Mac - just go to finder and type Terminal)
  2. FileZilla (just download it because it is free to use)
  3. Cloudways account (this is the best web hosting provider, in my opinion). Full disclosure: I am an affiliate of Cloudways.

Step A - Create a public/private SSH Keys using terminal

  1. Open Spotlight Search on upper right hand corner and type: terminal
  2. type in this command: ssh-keygen -t rsa -b 4096
  3. In the Enter a passphrase: hit enter to bypass the passphrase
  4. Congratulations! You just created a public and private SSH keys
Terminal Window on Mac
Terminal Window on the Mac

STEP B - Configure FileZilla with the Private SSH Key

Edit->Settings

Adding the private SSH key into FileZilla

Open FileZilla. On the header menu:

  1. Click Edit
  2. Select Settings
  3. In the Settings box, the left column is labeled Select page: click on SFTP
  4. On the right column, click on the "Add key file..." button

After you click on the "Add key file..." button, it will open up the finder. Unfortunately, the file you are looking for is stored in a hidden folder. Make sure that you are in the Users->Home folder. (or where you initially created the SSH keys). To view the invisible folder in the finder: press cmd + Shift + G while the open dialog window is open. This will drop down a "Go to the folder" screen. Type in .ssh and select the file id_rsa.

STEP C - Copy the contents of the Public SSH Key to your clipboard

The next step is to copy the contents of the Public SSH key to your clipboard so that you can later insert the public key to your web host account.

  1. Open Finder->Go->Go To Folder
  2. Type .ssh
  3. Right click on the id_rsa.pub file and select Open With-> TextEdit
  4. Select all of the text and copy (cmd + c)

STEP D - Login to Cloudways and enter the contents of the public SSH key

Click on the button to enter the contents of the public SSH key

You have to login to your web host account at Cloudways. Click on "Servers" and it will take you to the screen as shown above. Then, click on the button labeled "SSH PUBLIC KEYS".

  1. In the label, type in a description of the computer that you are using. In my case, since I am currently using a MacBook Air, I typed in MacBook Air.
  2. In the SSH Key field, paste (cmd + v) the contents from your clipboard from Step C.
  3. Click on the submit button.
  4. Under the Master Credentials you will see the Public IP. Click on the numbers to copy the Public IP into your clipboard (cmd + c). You will need this for the next step. Public IP is also known as the host.
  5. Make note of the Username located below the Public IP. You will enter this information in the next step in the field "user".

STEP E - Setting up the Site Manager in FileZilla

Now you need to open up FileZilla. You will fill in the information from step D.

  1. From the top Menu select File-> New Site. Click on the New Site button and type your domain name
  2. In the Protocol field, click on the dropdown menu and select: SFTP - SSH File Transfer Protocol
  3. In the Host field: Paste the IP address from your Cloudways account (see step D above) (cmd +v)
  4. In the Port field: 22
  5. In the Logon Type field: Interactive
  6. In the User: type the username from your Cloudways account (see step D)
  7. Click OK button
  8. To connect to the server, click on the Connect button

Phew! Congratulations! You can now securely login to your web host. In some cases you will need to change a few settings in the files to increase memory assigned to WordPress. But that's the next lesson.