zoukankan      html  css  js  c++  java
  • 在同一台电脑上添加多个ssh key

    1.创建新的ssh key:

    ssh-keygen -t rsa -C "your_email@email.com"

    然后让你输入新的文件名称,这里设置为new

    # 设置名称为Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): ~/.ssh/new

     

    2.密钥添加到SSH agent中

    ssh-add ~/.ssh/new

    ssh-add -l 可以查看添加过的密钥

    ssh-add -D 可以删除

     

    如果出现Could not open a connection to your authentication agen

    就执行:

    ssh-agent bash

    ssh-add ~/.ssh/new

     

    3.把创建的~/.ssh/new.pub中的内容添加到你的github账号上。

     

    4.在~/.ssh创建或者修改config文件

    # new
    Host new
    HostName github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/new

    5.测试

    ssh -T git@new

     

    6.clone仓库

    git clone git@new:username/git-demo.git

  • 相关阅读:
    reids 数据库学习
    java 8 学习二(Lambda表达式)
    java 8 学习一(概述)
    update Select 从查询的结果中更新表
    从一段文字中提取出uri信息
    Hadoop3.0磁盘均衡器
    MapReduce 程序mysql JDBC驱动类找不到原因及学习hadoop写入数据到Mysql数据库的方法
    yarn计算一个节点容量及其配置项
    YARN的capacity调度器主要配置分析
    1084 Broken Keyboard (20 分)字符串
  • 原文地址:https://www.cnblogs.com/huangshiyu13/p/6571751.html
Copyright © 2011-2022 走看看