git 的使用-linux上的配置 -ssh

来源:互联网 发布:一加该网络 编辑:程序博客网 时间:2024/05/19 15:44

1. 创建github 账号:

网站: https://github.com/

账号密码自己填。Ok

2. 进入Ubuntu命令编辑器。

1)生成SSH keys


[php] view plaincopy在CODE上查看代码片派生到我的代码片
  1. ssh-keygen -t rsa -C "yangyi@sina.cn"    



[php] view plaincopy在CODE上查看代码片派生到我的代码片
  1. root@yangyi:~# ssh-keygen -t rsa -C 'yangyi@sina.cn'  #这里填你的注册邮箱  
  2.   
  3. Generating public/private rsa key pair.  
  4.   
  5. Enter file in which to save the key (/root/.ssh/id_rsa):   #回车就可以,默认的路径  
  6.   
  7. Created directory '/root/.ssh'.  
  8.   
  9. Enter passphrase (empty for no passphrase): #输入密码,不一定要是注册密码  
  10.   
  11. Enter same passphrase again: #重复输入密码,看不见的  
  12.   
  13. Your identification has been saved in /root/.ssh/id_rsa.  
  14.   
  15. Your public key has been saved in /root/.ssh/id_rsa.pub.  
  16.   
  17. The key fingerprint is:  
  18.   
  19. a0:95:33:24:26:ca:b7:ed:c2:95:97:48:d4:e9:4f:89 yangyi@sina.cn  
  20.   
  21. The key's randomart image is:  
  22.   
  23. +--[ RSA 2048]----+  
  24.   
  25. |  . o.o .        |  
  26.   
  27. |.. o.o +         |  
  28.   
  29. |.. . .B . .      |  
  30.   
  31. |  . +ooE.o       |  
  32.   
  33. |   ..= oS        |  
  34.   
  35. |  . o .  .       |  
  36.   
  37. |   o .           |  
  38.   
  39. |    .            |  
  40.   
  41. |                 |  
  42.   
  43. +-----------------+  
  44.   
  45. root@yangyi:~#   





2)复制key github网站

打开,刚才生成的密钥:



全部复制,进入github 网站,点击Account settings


0 0
原创粉丝点击