您的当前位置:首页正文

SSHKey的生成

来源:要发发知识网
  1. 检查是否已经有SSH Key
    $ ls -al ~/.ssh

2.有的话直接使用命令复制
$ pbcopy < ~/.ssh/id_rsa.pub

没有就创建(带""),创建后再使用
ssh-keygen -t rsa -C "邮箱"

不重要的话可不设置密码

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/eelly/.ssh/id_rsa): 
Created directory '/Users/eelly/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/eelly/.ssh/id_rsa.
Your public key has been saved in /Users/eelly/.ssh/id_rsa.pub.```