git笔记
Ehoac Lv3

多用户配置 ssh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ssh-keygen -t rsa -C "example@email.com"

-- .ssh 目录下新建config文件
Host gitlab
User caopeihe
Hostname 192.168.3.17
IdentityFile ~/.ssh/id_rsa_gitlab
PreferredAuthentications publickey

Host github
User ehoac
Hostname github.com
IdentityFile ~/.ssh/id_rsa_github
PreferredAuthentications publickey

Host gitea
User ehoac
Hostname 127.0.0.1
IdentityFile ~/.ssh/id_rsa_gitea
PreferredAuthentications publickey

配置用户

1
2
git config --global user.email "example@email.com"
git config --global user.name "example"

gitea 重置密码

1
./gitea admin change-password --username username --password new_password

问题

XXX:Permission denied (password)

检查/etc/sshd_config中配置

1
2
RSAAuthentication yes
PubkeyAuthentication yes

修改后重启ssh服务

 评论