How to Generate an SSH Key Pair in Mac OS

Using Secure Shell Protocol (SSH) is a safer way of connecting to your web hosting server. SSH uses key pairs to ensure that the right client-server duo is communicating. This method offers greater integrity over a username and password authentication.

For SSH, the key pair involved is a private and public key. You must generate them at the same time on the same device. The method for SSH key pair generation will vary depending on what device you are using.

SSH Key Generation on Mac OS

  • Step 1. Open the Terminal via Applications -> Utilities -> Terminal
  • Step 2. Enter the following command: “ssh-keygen -t rsa”
  • Step 3. Provide the location where you wish to save the generated keys. Remember to include the file name to which you want to save them. For example, “/home/username/.ssh/mykeys_rsa”

If you do not wish to provide a custom location, hit enter to accept the default save location. By default, generated keys are save in “/home/yourusername/.ssh/” with the public and private keys named “id_rsa” and “id_rsa.pub” respectively.

  • Step 4. After key generation, the system will ask for a passphrase. You may skip this step by hitting the enter key. Hit the enter key again when asked to reconfirm the passphrase.

When complete, you should see a message similar to the following:

How to Generate an SSH Key Pair in Mac OS

Was this helpful?

Do you want to make your WordPress/WooCommerce site lightning fast?

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Just fill in the form below and we will get in touch with you.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Do you want to learn how to grow your website in 2023?

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. You will learn about:

  • What is the future of SEO and how you can be ahead of the curve
  • Web Design best practices and why they matter
  • Secrets to getting the foundation for your website to thrive

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

Rado
Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.