Gerrit配置使用
- 获取账号密码
- 生成ssh密钥对
(1) 确认是否已经有密钥对
ls ~/ssh
(2) 密钥对重新生成步骤
在linux系统终端执行:
ssh-keygen -t rsa -C "xxx@xxx.com"
- Gerrit网页配置
获取公钥cat ~/.ssh/id_rsa.pub
登录Gerrit, Settings -> SSH Public Key -> Add Key
- 本地环境配置
(1) 查看配置
git config --global --list
(2) 添加配置
git config --global url.ssh://xxx@xxx.com:xxx/.insteadof ssh://xxx.com
(3) 删除配置
git config --global --remove-section url.ssh
(4) 重新配置
git config --global --unset url.ssh
- 测试连接
ssh -p
SSH 配置使用
ssh-keygen -t rsa
记住账号密码
scp /home/xxx/.ssh/id_rsa.pub xx@8.8.8.8:/xxx/.ssh/authorized_keys