在 Mac 加入 ssh key 的步驟

  1. ssh-keygen -t ed25519 -C "{你的 email}"

    • 預設路徑假如已有相同檔案,記得指定新的完整路徑
    • 如檔名不用預設的,下面 id_ed25519 自行替換成自己的檔名
  2. vi ~/.ssh/config

    • 舉例:加上如下

      1
      2
      3
      4
      Host GitHub
      HostName github.com
      IdentityFile ~/.ssh/id_ed25519
      IdentitiesOnly yes
  3. ssh-add -K ~/.ssh/id_ed25519

    • register your private key with ssh-agent
  4. pbcopy < ~/.ssh/id_ed25519.pub

  5. 貼到所使用的服務網站的相對應設定頁面

評論

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×