Thursday, December 7, 2017

Add permanently ssh key on macOS

Run next command.
ssh-add -K ~/.ssh/[YOUR_PRIVATE_KEY]

Add config file in "~/.ssh/" with next contents.
Host github.com
    HostName github.com
    User enzinier
    PreferredAuthentications publickey
    IdentityFile /Users/jason/.ssh/enzinier-GitHub
    AddKeysToAgent yes
    UseKeychain yes

Key option is AddKeysToAgent, UseKeychain.