create public key for ssh macos code example Example 1: macos create ssh key ssh-keygen -t rsa Example 2: macos create new public key ssh-keygen -t rsa -b 4096