Вопрос

So, I followed this tutorial to install a gitolite server.

But my client machine is a Windows machine, not a Linux box.
So, instead of using ssh-keygen, I used Eclipse "ssh2" utility (in windows, preferences, general, network connections, ssh2).

I generated the .pub file and used to setup gitolite (like in the tutorial).
But it doesn't seems to work, I always get a "Connection refused: connect" when I try to connect to my server from windows using this URL :

ssh://gitolite@192.168.0.193:22/gitolite-admin

I opened the .pub files generated by Eclipse and what I find funny is that there is always 2 equals signs at the end.

For example, here's one generated public key :

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCQbDy+Nfoq+AitTrAbxy0PwRuBmgnm/vJk27KNOB3EzsZFKQ7+89I12nbxc8N+7z4Seq9fhNrYHfM7PvzgdI8F5QLxWbl2QV0UapBpjWmX+7WEE9bjEHIf7re3FpRzVdJrCAwscaUawmsIGi1rvw8ZFrbfPdS6ITiI10WcfTEdCw== RSA-1024
  1. Is it possible to try another key pair without having to reinstall gitolite?
  2. Can I generate the key pairs on my linux box and just upload the private key generated on my Windows machine?
  3. Any other help on how I can diagnose the problem would be great.

UPDATE #1 :

I found out that no ssh server was running on my server. You can see that with :

sudo nmap -sS xxx.xxx.xxx.xxx -p 22

If the port's state is closed, then your SSH service is either closed or doesn't exists. You can also try to connect with Putty (on windows) with SSH on your Linux machine, you'll see if the SSH server is working properly.

If your SSH service is not started, you can start the service with : sudo service ssh start

If the service doesn't exists, you'll need to install an ssh server. I installed mine (on Ubuntu) like this : sudo apt-get purge openssh-server sudo apt-get install openssh-server

After installing openssh, everything was working fine on my box.

Это было полезно?

Решение

First, if you have msysgit installed, you perfectly can use ssh-keygen (included in this msysgit module).
The official help page for installing gitolite can also help.

Don't worry about the two == at the end of the public key. It is normal, and what follows those two == is always ignored (for instance, you can place a comment here for you to remember what that public key is for, if you want).

Now:

  1. Is it possible to try another key pair without having to reinstall gitolite?
    .
    Yes. See "lost admin key/access":

    • Make yourself a new keypair and copy the public key to the server as 'alice.pub'.
    • Log on to the server, and run gitolite setup -pk alice.pub. .
      That's it; the new alice.pub file replaces whatever existed in the repo before.
  2. Can I generate the key pairs on my linux box and just upload the private key generated on my Windows machine?
    .
    No, you need both private and public key on your %HOME%/.ssh folder (which means you must have HOME environment variable defined on Windows)
    I would then recommend an %HOME%/.ssh/config file to use your keys.

  3. Any other help on how I can diagnose the problem would be great.
    .
    The official doc has many tips.
    I have a few ssh debugging tips as well.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top