Generate and Show SSH Key Using MacOS

To generate a SSH key using macOS, open the Terminal and enter the following command:

ssh-keygen -t rsa -b 4096 -C "mail@example.com"

To output the public key, use this command:

cat ~/.ssh/id_rsa.pub