前提
- 假设你已经正常使用 [email protected] 作为 GitHub 的账户,希望添加 [email protected] 作为 GitHub 的另一个账户。
- 假定 [email protected] 是更经常使用的账户,[email protected] 只是为了测试或较少使用。
创建新的 ssh 密钥
可以使用 ssh-keygen 来创建新的 ssh 密钥:
ssh-keygen -C "[email protected]"
创建过程中,假定使用 /Users/YOURNAME/.ssh/id_rsa2 作为存储路径,并且 ssh 密钥的密码为空。
创建后,将 id_rsa2.pub 也即公钥添加到 [email protected] 对应的 GitHub 账户中。