Test Gerrit SSH connection
After Gerrit installed, we only need to clone the gerrit down and can be changed to submit, and review.
gerrit download the code supports two ways: ssh and http.
Using ssh connection as follows:, gerrit url URL is: http://review.gerritsite.com/
1. locally generated ssh key, and affixed to gerrit.
- Using ssh-keygen command to generate a public and private key in the local account directory .ssh
- Log gerrit, the ~ / .ssh / id_rsa.pub, copy and paste the copied gerrit: http://review.gerritsite.com/#/settings/ssh-keys, can add more .
2. Test Links
公钥添加到gerrit上之后,就可以通过ssh命令来测试连接,gerrit的ssh默认端口号是29418;如果出现如下内容,表示连接成功。
$ ssh -p 29418 [email protected]
**** Welcome to Gerrit Code Review ****
Hi John Doe, you have successfully connected over SSH.
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:
git clone ssh://[email protected]:29418/REPOSITORY_NAME.git
Connection to hostname closed.
3. Get port information
通过curl命令,获取gerrit网站的ssh信息
$ curl http://review.gerritsite.com/ssh_info
review.gerritsite.com 29418