创建key
$ ssh-keygen
连续回车,选择默认配置。最后在~/.ssh目录下生成两个文件
$ ls ~/.ssh
id_rsa id_rsa.pub
拷贝Key
- Linux直接输出key的内容再复制
cat ~/.ssh/id_rsa.pub
- Mac下用如下命令可以将key拷贝到剪贴板
pbcopy < ~/.ssh/id_rsa.pub
$ ssh-keygen
连续回车,选择默认配置。最后在~/.ssh目录下生成两个文件
$ ls ~/.ssh
id_rsa id_rsa.pub
cat ~/.ssh/id_rsa.pub
pbcopy < ~/.ssh/id_rsa.pub