====== OpenSSH on macOS ======
==== 1. How to generate your SSH private key and public key ====
On your macOS ''Terminal'' application, you type the command.
|macOS$ ''ssh-keygen -t ecdsa''| This command generates your SSH private key and public key of the ECDSA type.|
|Enter file in which to save the key (/Users/XXXX/.ssh/id_ecdsa):
|This inquiry is where your SSH key will be placed. Do not change.|
|Enter passphrase (empty for no passphrase):
|To prevent misuse of your SSH private key, please enter your passphrase in this query. This ''passphrase'' does not have to be the same as your login password.|
Your SSH public key is ''$HOME/.ssh/id_ecdsa.pub''.
Then you register the generated key in your macOS ''keychain'' application
ssh-add -K $HOME/.ssh/id_ecdsa
.
==== 2. Optional ====
Create ''$HOME/.ssh/config'' file like the following:
Host *
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
IdentityFile /Users/XXXX/.ssh/id_ecdsa
UseKeychain yes
AddKeysToAgent yes
Replace ''XXXX'' with your macOS username.
The ''UseKeychain'' is for macOS only.
----
* [[public:top|Public]]