Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
hofmann
Active Contributor
0 Kudos

[See the document Install Gerrit in Tomcat under Windows on how to install Gerrit.]

To effectively work with Gerrit, you use SSH. The need to enter a password is substituted by transmitting a key. This authentication method allows for background processing and automation. First step is to create a SSH key and make Gerrit aware of that key. Gerrit comes with a documentation explaining how to create and add the SSH key. To see this dialog, log on to Gerrit, open the settings page and select the SSH Public Keys option.

To follow this documentation on Windows, it means to:

  1. Open git bash
  2. Run ssh-keygen
  3. Enter a passphrase
  4. Open the id_rsa.pub file in Notepad and copy/paste the key to Gerrit.

The first 3 steps generate a private and public key. The private key will stay on the user home directory, the public key will be added to Gerrit.

The public key is id_rsa.pub. Open this file to see your public key.

Copy the public key  into clipboard and paste it to Gerrit: open the SSH Public Keys page and add the public key generated above.

As a result, your public key is added to Gerrit, allowing you to log on to Gerrit using SSH and not be prompted to enter a password.

To test if Gerrit is accepting automatic logon via SSH, just connect to the Gerrit’s SSH server. By default, the SSH server is listening on port 29418. Open Git bash and issue the command

ssh –p 29418 <username>@localhost

If everythink works, the result should look like:

Very likely possible error to receive

It is very likely that when running the above SSH command, that you won't get automatically logged on, but instead see this message: Could not open a connection to your authentication agent.

This means that SSH is not able to use your private key. Follow the steps outlined at [1] to start the ssh-agent process.

exec ssh-agent bash
ssh-add path/to/.ssh/id_rsa

Now add your identity by opening git bash and run

  1. ssh-add –l to see if your ssh-agent is running and accepting connections and
  2. ssh-add <path to your private key>

Now ssh will be able to use your private key.

[1] http://imikay.wordpress.com/2011/08/06/ssh-add-could-not-open-a-connection-to-your-authentication-ag...

Labels in this area