• 生成并部署SSH key


    在win7安装完Git,使用Git Bash输入命令步骤如下:

    1、git config --global user.name "usernme"

    2、git config --global user.email emailName

    3、git bash 进入工程目录:git init

    4、使用git add filename 将文件添加到库

    5、使用git commit -m "first commit" 进行提交

    6、使用ssh-keygen -C 'emailName@163.com' -t rsa

    7、在pub文件中copy key,添加当GitHub中的SSH keys

    8、ssh -T git@github.com进行验证出现错误:Permission denied (publickey).

    这该怎么解决?查找了很多资料,都没有解决!(emailName@163.com是我GitHub注册邮箱,username是我GitHub的用户名)

     

    官方:

    1.如何生成ssh公钥

    你可以按如下命令来生成 sshkey:

    ssh-keygen -t rsa -C "xxxxx@xxxxx.com"  
    
    # Generating public/private rsa key pair...
    # 三次回车即可生成 ssh key
    

    查看你的 public key,并把他添加到码云(Gitee.com) SSH key添加地址:https://gitee.com/profile/sshkeys)

    cat ~/.ssh/id_rsa.pub
    # ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....
    

    添加后,在终端(Terminal)中输入

    ssh -T git@gitee.com
    

    若返回

    Welcome to Gitee.com, yourname!
    

    则证明添加成功。


    2.怎么添加用户 ssh key?

    1. 进入个人设置页面---》SSH 公钥添加,具体链接
    2. 截图如下 输入图片说明

    3.项目的 ssh key 和用户的 ssh key 两处地方有什么不同?

    项目的 sshkey 只针对项目,且我们仅对项目提供了部署公钥,即项目下的公钥仅能拉取项目,这通常用于生产服务器拉取仓库的代码。 而用户的 key 则是针对用户的,用户添加了 key 就对用户名下的项目和用户参加了的项目具有权限,一般而言,用户的key具有推送和拉取的权限,而项目的 key 则只具有拉取权限。

    在win7安装完Git,使用Git Bash输入命令步骤如下:

    1、git config --global user.name "usernme"

    2、git config --global user.email emailName

    3、git bash 进入工程目录:git init

    4、使用git add filename 将文件添加到库

    5、使用git commit -m "first commit" 进行提交

    6、使用ssh-keygen -C 'emailName@163.com' -t rsa

    7、在pub文件中copy key,添加当GitHub中的SSH keys

    8、ssh -T git@github.com进行验证出现错误:Permission denied (publickey).

    这该怎么解决?查找了很多资料,都没有解决!(emailName@163.com是我GitHub注册邮箱,username是我GitHub的用户名)

  • 相关阅读:
    Cuckoo Hashing
    Microsoft Windows的消息循环
    Simplex, Full-Duplex and Half-Duplex Operation
    Linux 技巧:让进程在后台运行更可靠的几种方法
    https://learnku.com/docs/go-blog/qihoo/6532 。 heap size went up to 69G, with maximum garbage collection (GC)
    Go GC: Latency Problem Solved
    Sapphire: Copying GC Without Stopping the World
    The Go Blog Getting to Go: The Journey of Go's Garbage Collector
    xml CDATA
    Joseph cicyle's algorithm
  • 原文地址:https://www.cnblogs.com/matd/p/10969312.html
Copyright © 2020-2023  润新知