01-GIT生成.ssh文件夹
Posted zhangmazi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了01-GIT生成.ssh文件夹相关的知识,希望对你有一定的参考价值。
git:
生成.ssh文件夹
ssh-keygen -t rsa
ninedeMacBook-Pro:~ nine$ cd .ssh/
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/nine/.ssh/id_rsa): rsa1(给生成生成私钥命名)
Enter passphrase (empty for no passphrase):设置输入密码
Enter same passphrase again:
Your identification has been saved in rsa1.// 私钥
Your public key has been saved in rsa1.pub.// 公钥
The key fingerprint is:
SHA256:/O4WmOZJqHuVJup+M3JSNVaDSz9+RHi8EkZ36CiOHw8 xx@xxx.com
The key‘s randomart image is:
+---[RSA 2048]----+
| o.o... |
| o *.=. |
| . = B . |
| .* = + |
| *SB + |
| = E.o . |
| + O =.o |
| = * +.o |
| o+B o oo |
+----[SHA256]-----+
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$ ls // 查看生成文件
rsa1 rsa1.pub
ninedeMacBook-Pro:.ssh nine$ .ssh lele$ cat id_rsa1.pub
-bash: .ssh: command not found
ninedeMacBook-Pro:.ssh nine$ cat id_rsa1.pub
cat: id_rsa1.pub: No such file or directory
ninedeMacBook-Pro:.ssh nine$ cat rsa1.pub //复制一下在gitlab
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXyHmGOi8o7E462VyOhWf76GZ80CFcLRLfNDVl0e6nh8uvPHQNf58Yb19RtqNm2G0x1CXSjXGv8i5RaO/RtU101u4sBBkQxPeKoJlHBvi3t8fKnlBr6BvV5YGEWzYJSRNhQ7zStADne/lm+jqxDBcsMb4RmCyzVSNFFQqhzu/DYK0MfRcsEcQ7D95h9ewmY4vRGsaeTQO/Jin3nCu3jD3aR8yoosxvLaPi8+goTD95UIIdOW4yLU1I0EC++aiZU6XJdaVHoD3a8HYxvl41Z2tbvgA6CQg1OFmBYosoU1CySg54GeRGge4+dGlan2iOU0NOrENQCNzTLvQRQJEUGPPL xx@xxx.com
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$ ls
rsa1 rsa1.pub
ninedeMacBook-Pro:.ssh nine$ ssh-add rsa1
Enter passphrase for rsa1: // 输入密码 此密码为生成密钥的时候设置的密码
Identity added: rsa1 (rsa1)
ninedeMacBook-Pro:.ssh nine$
ninedeMacBook-Pro:.ssh nine$
仓库地址xxxxxxx
进入项目成员xxxxxxx
本人sourcetree运行期间错误:
直接从sourcetree官网下载的,然后配置sshkey,代码克隆下来了,在之后的本地文件更新 远程仓库的更新 代码的拉取推送的时候会一直报错,英文显示报错的大致意思是 设备配置错误。
解决:1.重装Mac系统 mac电脑本身自带一个系统
2.安装的2.6.2版本的sourcetree 其他正常配置