【发布时间】:2022-04-21 22:33:03
【问题描述】:
问题:如何使用命令行生成 ssh 私钥和公钥(用于 GitHub/GitLab)。
下面的命令会产生错误
sh.exe": syntax error near unexpected token '('
我使用的是 Windows XP。
$ ssh-keygen -t rsa -C "xxxx@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxxx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xxxx/.ssh/id_rsa.
Your public key has been saved in /c/Users/xxxx/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db xxxx@gmail.com
【问题讨论】:
-
错误消息看起来像您正在尝试运行
bash脚本,但改用sh。见Difference between sh and bash