$ ssh-keygen -t rsa -c "xxxxx@163.com"
Too many arguments.
Git Bash (基於 Linux 環境)**嚴格區分大小寫** :
ssh-keygen -t rsa -C "your_email@example.com"
# -t rsa 指定加密類型為 RSA
# -C "..." 大寫 C,添加註釋
# 回車三次 (文件路徑、密碼、確認密碼) 即可生成 ~/.ssh/id_rsa 和 id_rsa.pub
# 1. 啟動 ssh-agent 並添加私鑰
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
# 2. 複製公鑰內容
cat ~/.ssh/id_rsa.pub
# 輸出類似:ssh-rsa AAAAB3NzaC1yc2E... your_email@example.com
# 3. 粘貼到 GitHub/GitLab/Gitee 等平台的 SSH Keys 設置頁