美文网首页
ssh-keygen用法

ssh-keygen用法

作者: happyyy2017 | 来源:发表于2017-06-08 00:08 被阅读236次

    git pull/push等操作时不想输入用户名和密码,则需要采用数字签名rsa来完成。

    具体操作

    1、查看本机git config 配置

    git config --list

    查看user.email信息,假设为123456@163.com

    2、通过ssh-keygen生成公钥和私钥

    ssh-keygen -t rsa -C "123456@163.com"

    连续按3个回车

    公钥和私钥生成的路径:cd ~/.ssh,下面有两个文件id_rsa(私钥文件),rsa.pub(公钥文件)

    3、将生成的公钥添加到gitlab上,名称为邮箱名。

    配置完成,git clone/push/pull 不需要输入密码了

    相关文章

      网友评论

          本文标题:ssh-keygen用法

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