-
首先启动一个Git Bash窗口(非Windows用户直接打开终端)
-
执行:
cd~ /.ssh
<p> 如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份! </p> </div> </li> <li class="level1"> <div class="li">备份: <pre class="code bash">
mkdirkey_backup mvid_isa *key_backup
-
生成新的Key:(引号内的内容替换为你自己的邮箱)
ssh-keygen -trsa -C "[email protected]"
<p> 输出显示: </p>
Generating public/private rsa key pair. Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<press enter>
<p> 直接回车,不要修改默认路劲。 </p> <pre class="code bash">Enter passphrase
(empty forno passphrase ): <enter a passphrase > Enter same passphrase again: <enter passphrase again >
<p> 设置一个密码短语,在每次远程操作之前会要求输入密码短语!闲麻烦可以直接回车,不设置。 </p> </div> </li> <li class="level1"> <div class="li">成功:
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: ... ...
</div> </li>
-
-
Save cssoul/73b386dc7d01a8151ccc to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment