生成SSH key
来源:互联网 发布:wsn网络分析器下载 编辑:程序博客网 时间:2024/05/29 18:34
使用git的过程中,我们会初始化创建关联服务器的SSH key.
1 设置用户名和邮箱
开发过程中,提交的时候会在log中显示用户名和密码,便于管理。
$ git config --global user.name "阳君"$ git config --global user.email "937447974@qq.com"
2 检查现有的SSH keys
在创建SSH keys之前,我们可以看看电脑内是否有SSH keys秘钥。
打开Terminal输入如下命令。
$ ls -al ~/.ssh
或输入
$ ls ~/.ssh
如果看见如下文件,则代表SSH keys已创建好。
- id_dsa.pub
- id_ecdsa.pub
- id_ed25519.pub
- id_rsa.pub
查看已创建好的SSH key,使用如下命令。
$ cd ~/.ssh$ cat id_rsa.pub
3 生成新的SSH key
如果没创建SSH key,我们可以创建新的SSH key。
1 设置电子邮件并创建对应的key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"# Creates a new ssh key, using the provided email as a labelGenerating public/private rsa key pair.
2 设置文件存储位置,直接“回车”。
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
3 设置密码时,可设置空密码。
Enter passphrase (empty for no passphrase): [Type a passphrase]Enter same passphrase again: [Type passphrase again]
4 添加SSH key到ssh-agent
# start the ssh-agent in the backgroundeval "$(ssh-agent -s)"Agent pid 59566$ssh-add ~/.ssh/id_rsa
此时SSH key创建完毕。
Appendix
Related Documentation
Generating an SSH key
Revision History
Copyright
CSDN:http://blog.csdn.net/y550918116j
GitHub:https://github.com/937447974/Blog
0 0
- 生成ssh key
- 如何生成SSH key
- git生成ssh key
- 如何生成SSH key
- git 生成SSH KEY
- 如何生成SSH key
- 生成SSH key
- sourcetree ssh key生成
- Git SSH Key生成
- git生成ssh key
- GIT 生成 SSH key
- linux生成SSH key
- Mac生成ssh key
- 如何生成ssh key
- 如何生成SSH key
- git ssh key 生成
- 如何生成SSH key
- ssh key生成
- Oracle数据库Sql语句详解之SELECT查询基本语法
- mediacodec编解码少帧问题
- Spring的注入方式
- tsiLredroeR.143
- 考研信息查找
- 生成SSH key
- Android 5.0 Material Design系列
- Oracle数据库Sql语句详解----条件查询
- iOS开发-Apple开发者账号申请流程
- EXC_BAD_ACCESS的本质详解以及僵尸模式调试原理
- 4.5.2.2 onScrollStateChanged()和onScrolled()的区别
- Xcode实用快捷键
- C语言的宏定义
- 关于linux中so链接a