美文网首页iOSer 的自我修养
mac上创建并配置ssh公钥

mac上创建并配置ssh公钥

作者: 爱吃馒头的二饼 | 来源:发表于2019-07-12 14:33 被阅读0次

进入ssh目录
cd ~/.ssh

如果有,可以删掉;如果没有,会提示No such file or directory

创建
ssh-keygen -t rsa -C "你的邮箱地址"

会提示选择存储位置,直接回车即可
Enter file in which to save the key (/Users/hansion/.ssh/id_rsa):
然后会提示你创建了一个目录

提示设置ssh的密码,输入两次,并且输入的时候不会显示
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

然后会提示存储位置等信息
Your identification has been saved in /Users/hansion/.ssh/id_rsa.
Your public key has been saved in /Users/hansion/.ssh/id_rsa.pub.

打开ssh文件夹
open ~/.ssh

用xcode等工具打开id_rsa.pub,将里面的全部内容复制,添加到Github等网站上即可

相关文章

网友评论

    本文标题:mac上创建并配置ssh公钥

    本文链接:https://www.haomeiwen.com/subject/cmwekctx.html