Skip to content

Instantly share code, notes, and snippets.

@cssoul
Forked from yisibl/git-key.md
Created June 16, 2014 07:02

Revisions

  1. @yisibl yisibl revised this gist Apr 30, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions git-key.md
    Original file line number Diff line number Diff line change
    @@ -39,4 +39,5 @@
    6. 提交公钥:

    6.1 找到.ssh文件夹,用文本编辑器打开“id_rsa.pub”文件,复制内容到剪贴板。

    6.2 打开 https://github.com/settings/ssh ,点击 Add SSH Key 按钮,粘贴进去保存即可。
  2. @yisibl yisibl revised this gist Apr 30, 2014. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions git-key.md
    Original file line number Diff line number Diff line change
    @@ -4,34 +4,34 @@

    2. 执行:

    cd ~/.ssh
    >cd ~/.ssh
    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

    3. 备份:

    mkdir key_backup
    >mkdir key_backup
    mv id_isa* key_backup

    4. 生成新的Key:(引号内的内容替换为你自己的邮箱)

    ssh-keygen -t rsa -C "your_email@youremail.com"
    >ssh-keygen -t rsa -C "your_email@youremail.com"
    输出显示:

    Generating public/private rsa key pair. Enter file in which to save the key
    >Generating public/private rsa key pair. Enter file in which to save the key
    (/Users/your_user_directory/.ssh/id_rsa):<press enter>

    直接回车,不要修改默认路劲。

    Enter passphrase (empty for no passphrase):<enter a passphrase>
    >Enter passphrase (empty for no passphrase):<enter a passphrase>
    Enter same passphrase again:<enter passphrase again>

    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。

    5. 成功:

    Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    >Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
    The key fingerprint is:
    ... ...
  3. @yisibl yisibl revised this gist Apr 30, 2014. 1 changed file with 10 additions and 7 deletions.
    17 changes: 10 additions & 7 deletions git-key.md
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,10 @@
    1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

    2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!
    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

    3. 备份:

    @@ -14,26 +15,28 @@

    4. 生成新的Key:(引号内的内容替换为你自己的邮箱)

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

    输出显示:
    输出显示:

    Generating public/private rsa key pair. Enter file in which to save the key
    (/Users/your_user_directory/.ssh/id_rsa):<press enter>
    Generating public/private rsa key pair. Enter file in which to save the key
    (/Users/your_user_directory/.ssh/id_rsa):<press enter>

    直接回车,不要修改默认路劲。
    直接回车,不要修改默认路劲。

    Enter passphrase (empty for no passphrase):<enter a passphrase>
    Enter same passphrase again:<enter passphrase again>

    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。
    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。

    5. 成功:

    Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
    The key fingerprint is:
    ... ...

    6. 提交公钥:

    6.1 找到.ssh文件夹,用文本编辑器打开“id_rsa.pub”文件,复制内容到剪贴板。
    6.2 打开 https://github.com/settings/ssh ,点击 Add SSH Key 按钮,粘贴进去保存即可。
  4. @yisibl yisibl revised this gist Apr 30, 2014. 1 changed file with 37 additions and 76 deletions.
    113 changes: 37 additions & 76 deletions git-key.md
    Original file line number Diff line number Diff line change
    @@ -1,78 +1,39 @@
    <h1 class="sectionedit1"><a name="如何创建公钥" id="如何创建公钥">如何创建公钥</a>
    </h1>
    <div class="level1">
    <ol>
    <li class="level1">
    <div class="li">首先启动一个Git Bash窗口(非Windows用户直接打开终端)</div>
    </li>
    <li class="level1">
    <div class="li">执行:
    <pre class="code bash">
    <span class="kw3">cd</span>~
    <span class="sy0">/</span>.ssh</pre>

    <p>
    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!
    </p>
    </div>
    </li>
    <li class="level1">
    <div class="li">备份:
    <pre class="code bash">
    <span class="kw2">mkdir</span>key_backup
    <span class="kw2">mv</span>id_isa
    <span class="sy0">*</span>key_backup</pre>
    </div>
    </li>
    <li class="level1">
    <div class="li">生成新的Key:(引号内的内容替换为你自己的邮箱)
    <pre class="code bash">
    <span class="kw2">ssh-keygen</span>
    <span class="re5">-t</span>rsa
    <span class="re5">-C</span>
    <span class="st0">"your_email@youremail.com"</span>
    </pre>
    <p>
    输出显示:
    </p>
    <pre class="code">
    ## 如何创建公钥

    1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

    2. 执行:
    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

    3. 备份:

    mkdir key_backup
    mv id_isa* key_backup

    4. 生成新的Key:(引号内的内容替换为你自己的邮箱)

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

    输出显示:

    Generating public/private rsa key pair. Enter file in which to save the key
    (/Users/your_user_directory/.ssh/id_rsa):&lt;press enter&gt;
    </pre>
    <p>
    直接回车,不要修改默认路劲。
    </p>
    <pre class="code bash">Enter passphrase
    <span class="br0">(</span>empty
    <span class="kw1">for</span>no passphrase
    <span class="br0">)</span>:
    <span class="sy0">&lt;</span>enter a passphrase
    <span class="sy0">&gt;</span>
    Enter same passphrase again:
    <span class="sy0">&lt;</span>enter passphrase again
    <span class="sy0">&gt;</span>
    </pre>
    <p>
    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。
    </p>
    </div>
    </li>
    <li class="level1">
    <div class="li">成功:
    <pre class="code">
    Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
    The key fingerprint is: ... ...
    </pre>
    </div>
    </li>
    <li>提交公钥:
    <p>找到.ssh文件夹,用文本编辑器打开“id_rsa.pub”文件,复制内容到剪贴板。</p>
    </li>
    </ol>

    </div>
    (/Users/your_user_directory/.ssh/id_rsa):<press enter>

    直接回车,不要修改默认路劲。

    Enter passphrase (empty for no passphrase):<enter a passphrase>
    Enter same passphrase again:<enter passphrase again>

    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。

    5. 成功:
    Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
    The key fingerprint is:
    ... ...

    6. 提交公钥:
    6.1 找到.ssh文件夹,用文本编辑器打开“id_rsa.pub”文件,复制内容到剪贴板。
    6.2 打开 https://github.com/settings/ssh ,点击 Add SSH Key 按钮,粘贴进去保存即可。
  5. @yisibl yisibl revised this gist Dec 18, 2013. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion git-key.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    <h1 class="sectionedit1">如何创建 Git 公钥</h1>
    <h1 class="sectionedit1"><a name="如何创建公钥" id="如何创建公钥">如何创建公钥</a>
    </h1>
    <div class="level1">
    <ol>
    <li class="level1">
    @@ -68,6 +69,9 @@ The key fingerprint is: ... ...
    </pre>
    </div>
    </li>
    <li>提交公钥:
    <p>找到.ssh文件夹,用文本编辑器打开“id_rsa.pub”文件,复制内容到剪贴板。</p>
    </li>
    </ol>

    </div>
  6. @yisibl yisibl created this gist Dec 18, 2013.
    74 changes: 74 additions & 0 deletions git-key.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,74 @@
    <h1 class="sectionedit1">如何创建 Git 公钥</h1>
    <div class="level1">
    <ol>
    <li class="level1">
    <div class="li">首先启动一个Git Bash窗口(非Windows用户直接打开终端)</div>
    </li>
    <li class="level1">
    <div class="li">执行:
    <pre class="code bash">
    <span class="kw3">cd</span>~
    <span class="sy0">/</span>.ssh</pre>

    <p>
    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!
    </p>
    </div>
    </li>
    <li class="level1">
    <div class="li">备份:
    <pre class="code bash">
    <span class="kw2">mkdir</span>key_backup
    <span class="kw2">mv</span>id_isa
    <span class="sy0">*</span>key_backup</pre>
    </div>
    </li>
    <li class="level1">
    <div class="li">生成新的Key:(引号内的内容替换为你自己的邮箱)
    <pre class="code bash">
    <span class="kw2">ssh-keygen</span>
    <span class="re5">-t</span>rsa
    <span class="re5">-C</span>
    <span class="st0">"your_email@youremail.com"</span>
    </pre>
    <p>
    输出显示:
    </p>
    <pre class="code">
    Generating public/private rsa key pair. Enter file in which to save the key
    (/Users/your_user_directory/.ssh/id_rsa):&lt;press enter&gt;
    </pre>
    <p>
    直接回车,不要修改默认路劲。
    </p>
    <pre class="code bash">Enter passphrase
    <span class="br0">(</span>empty
    <span class="kw1">for</span>no passphrase
    <span class="br0">)</span>:
    <span class="sy0">&lt;</span>enter a passphrase
    <span class="sy0">&gt;</span>
    Enter same passphrase again:
    <span class="sy0">&lt;</span>enter passphrase again
    <span class="sy0">&gt;</span>
    </pre>
    <p>
    设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。
    </p>
    </div>
    </li>
    <li class="level1">
    <div class="li">成功:
    <pre class="code">
    Your identification has been saved in /Users/your_user_directory/.ssh/id_rsa.
    Your public key has been saved in /Users/your_user_directory/.ssh/id_rsa.pub.
    The key fingerprint is: ... ...
    </pre>
    </div>
    </li>
    </ol>

    </div>