您的位置:首页 > 其它

git使用SSH连接oschina

2016-07-22 10:53 323 查看
生成ssh公钥

ssh-keygen -t rsa -C "xxxxx@xxxxx.com"


根据提示,一路回车,千万别输密码,输了还不如用https了

然后到.ssh文件夹下找到id_rsa.pub文件

注:window和mac按自己的方式找到用户根目录

复制内容,到oschina中找到SSH公钥管理,添加一个新的公钥。

注:clone的时候需要使用ssh地址

--------------------------------------------------------------------------------
$ssh-keygen -t rsa -C "${YourEmail}"                            # "-t rsa"表示使用密钥的加密类型,还可以为dsa;-C设置注释文字,比如你的邮箱“YourEmail”,不一定要是github注册邮箱
Enter file in which to save the key (/Users/faner/.ssh/id_rsa): # 直接回车
Enter passphrase (empty for no passphrase):                     # 输入密钥文件授权密码
Enter same passphrase again:                                    # 确认密钥文件授权密码
Your identification has been saved in /Users/faner/.ssh/id_rsa.
Your public key has been saved in /Users/faner/.ssh/id_rsa.pub.
--------------------------------------------------------------------------------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git rsa ssh