Skip to main content

How to Generate SSH Keys in Mac

Asher Anwer avatar
Written by Asher Anwer
Updated over a week ago

Generating SSH keys on a Mac is a straightforward process that helps enhance the security of your remote connections. SSH keys offer a more secure and efficient alternative to using passwords when connecting to servers. In this article, we’ll walk you through the steps to create SSH keys on your Mac, so you can set up secure access for development, deployments, or managing remote systems.

  1. Open the terminal on your Mac. You can find it in Applications > Utilities > Terminal or search for it with Spotlight (Cmd + Space → type “Terminal”).

  2. Use the command below to generate SSH keys.

    ssh-keygen -t rsa -b 4096

    It will ask you for the full path to save the SSH keys. If you press Enter, the keys will be generated at the default path shared below. After that, it will prompt you to enter a passphrase. If you want to set one, type it and press Enter. If you prefer to leave it blank, just press Enter without typing anything.

    /var/root/.ssh/id_rsa.pub

  3. You have successfully generated your SSH key pair. The private key remains on your computer, while the public key must be uploaded to the server you want to connect to.

  4. You can use the command below to copy your public key and save it to the server you want to connect to.

    cat /var/root/.ssh/id_rsa.pub



Congratulations! You've successfully generated SSH keys on your Mac.

If you have any questions, please don’t hesitate to contact our team via live chat.

For technical inquiries, please feel free to reach our support team by emailing support@bigscoots.com from your registered email or by submitting a support ticket.

Did this answer your question?