Mac 下source tree 与 gitlab 添加 ssh **

时间:2024-04-09 11:17:18

配置方法:
在普通用户 进入 .ssh 文件
cd .ssh/ 或 cd ~/.ssh
HaRiMacBook-Pro:~ lelecd.ssh/HaRiMacBookPro:.sshlelecd.ssh/HaRiMacBook−Pro:.sshlele ls
known_hosts
HaRiMacBook-Pro:.ssh lelemansshaddHaRiMacBookPro:.sshlelemanssh−addHaRiMacBook−Pro:.sshlele
HaRiMacBook-Pro:.ssh lele$ ssh-****** -t rsa -C “your email” // 你的邮箱
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/lele/.ssh/id_rsa): id_rsa1 // 给生成生成私钥命名
Enter passphrase (empty for no passphrase): // 设置输入密码
Enter same passphrase again:
Your identification has been saved in id_rsa1. // 私钥
Your public key has been saved in id_rsa1.pub. // 公钥
The key fingerprint is:
SHA256:IL6L2NjBQDAAuYfD6NzTbR8VIc/fJl1coDUhzL3LYP8 [email protected]
The key’s randomart image is:
+—[RSA 2048]—-+
|B. . +o.=o.|
|o. +.o+.o.|
|o+ . . oo .o|
|*… . . .+ + .|
|+o. o . S .. * = |
| = o o o . * |
| o o … . |
| = o . . E|
|o + . |
+—-[SHA256]—–+
HaRiMacBook-Pro:.ssh leleHaRiMacBookPro:.sshleleHaRiMacBook−Pro:.sshlele
HaRiMacBook-Pro:.ssh leleHaRiMacBookPro:.sshleleHaRiMacBook−Pro:.sshlele ls // 查看生成文件
id_rsa id_rsa1id_rsa1.pubknown_hosts
HaRiMacBook-Pro:.ssh lele$ cat id_rsa1.pub // 打开公钥 复制公钥粘贴到 gitlab上设置 sshKey 的地方

ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQDIRPiN+aEeJ4ZAYshiKdDSv9tHovvmKCIai8uUc8RqxYo5BPJwN5NLH5FVKgIO12uj4PZl4q/QpXh9oaPVKJLZWTGh7aZc2lBmqS8CDLnFAniFnhYb5CABg+gQyFv71857UeV4QaO6sPas6jYFyeMgguEylzFUVz2dxsjonoGnPxA14YxG0k1bvkuQT1MEuwcyN17vOZYPOyh5xBfTJMYrqp3V875ju508SUgE+oFYXoJF/bMoUXPH+9D7YSTTqbocv55Su7z95/LMhp5RNX4MwMxJF9LdcLwTWvXuPucB6RbsRLqf9hy53/boLyphgc0UKpHNgPZTnCYRKJ8+hwrL
[email protected]

HaRiMacBook-Pro:.ssh leleHaRiMacBookPro:.sshleleHaRiMacBook−Pro:.sshlele
HaRiMacBook-Pro:.ssh leleHaRiMacBookPro:.sshleleHaRiMacBook−Pro:.sshlele ls
id_rsa id_rsa1id_rsa1.pubknown_hosts
HaRiMacBook-Pro:.ssh lele$ ssh-add id_rsa1 // 添加私钥

Enter passphrase for id_rsa1: // 输入密码 此密码为生成**的时候设置的密码 12345678 方便好记
Identity added: id_rsa1 (id_rsa1)
HaRiMacBook-Pro:.ssh lele$

至此 sshKey 配置完成,打开 source tree check代码就 OK 了!

Mac 下source tree 与 gitlab 添加 ssh **

iOS开发者交流群:①446310206 ②446310206

推荐资源:

iOS-Swift-Developers

iOS-OC-Developer