码云配置免密登录

1、配置 git, 进入 git bash
# 配置用户名

git config --global user.name "username" //(名字)

# 配置邮箱

git config --global user.email "username@email.com" //(注册账号时用的邮箱)

2、 配置 ssh 免密登录

https://gitee.com/help/articles/4181#article-header0

进入 git bash; 使用: ssh-keygen -t rsa -C "xxxxx@xxxxx.com"命令。 连续三次回车。
一般用户目录下会有

或者 cat ~/.ssh/id_rsa.pub
登录进入 gitee, 在设置里面找到 SSH KEY 将.pub 文件的内容粘贴进去

使用 ssh -T git@gitee.com 测试是否成功即可

Git+码云教程 https://gitee.com/help/articles/4104

控制太命令

Administrator@konglx MINGW64 /d/2022_work
$ git config --global user.name "china—coding"

Administrator@konglx MINGW64 /d/2022_work
$ git config --global user.email "xxx@163.com"

Administrator@konglx MINGW64 /d/2022_work
$ ssh-keygen -t rsa -C "xxx@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Created directory '/c/Users/Administrator/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:LfL9aSaSPfJhakV8vMwrCC xxx@163.com
The key's randomart image is:
+---[RSA 3072]----+
|       . .   .   |
|        * . . oE |
|     . o = o    o|
|      o  .+ + o.*|
|     o..S..     =|
|    . =o         |
|     o ..=+  o . |
|        *o=o+..  |
|       ..+.*o    |
+----[SHA256]-----+

Administrator@konglx MINGW64 /d/2022_work
$ cat ~/.ssh/id_rsa.pub
ssh-rsa xxx@163.com

Administrator@konglx MINGW64 /d/2022_work
$ ssh -T git@gitee.com
The authenticity of host 'gitee.com (212.64.62.183)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
Hi xxx! You've successfully authenticated, but GITEE.COM does not provide shell access.

Administrator@konglx MINGW64 /d/2022_work

 

posted @ 2022-02-16 23:50  程序员小明1024  阅读(469)  评论(0编辑  收藏  举报