Skip to content

Instantly share code, notes, and snippets.

@scandav
Created September 21, 2022 14:09
Show Gist options
  • Save scandav/95fe9dc63572ef51930f55f6ffa11bbf to your computer and use it in GitHub Desktop.
Save scandav/95fe9dc63572ef51930f55f6ffa11bbf to your computer and use it in GitHub Desktop.
SSH Key for MAC M1
  1. ssh-keygen -t rsa -b 4096 -C "ubelix" and decide path and passphrase.
  2. Add to ~/.ssh/config:
    Host ubelix
     UseKeychain yes
     AddKeysToAgent yes
     IdentityFile ~/.ssh/id_rsa_ubelix
     Hostname submit03.unibe.ch
     User <YOUR_USER_HERE>
     ServerAliveInterval 60
    
  3. ssh-copy-id -i ~/.ssh/id_rsa_ubelix.pub ubelix.
  4. ssh-add --apple-use-keychain ~/.ssh/id_rsa_ubelix for Monterey OS.
  5. ssh ubelix. If you have issue with password prompting, verify home directory permissions (it might be useful to run ssh in verbose mode).

Resources: https://apple.stackexchange.com/questions/48502/how-can-i-permanently-add-my-ssh-private-key-to-keychain-so-it-is-automatically/250572#250572?newreg=b47f016d62404bcd8aa99020c400c454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment