Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When Installing gitolite I get "/tmp/id_rsa.pub does not seem to be a valid ssh pubkey file"

Tags:

git

gitolite

I'm trying to install git and gitolite for our development in a CentOS linux server. Everything so far has ran ok except the step where I define the admin user for gitolite with this command:

gitolite setup -pk /tmp/id_rsa.pub
FATAL: errors found but logfile could not be created
FATAL: /home/git/.gitolite/logs/gitolite-2013-05.log: No such file or directory
FATAL: die      '/tmp/id_rsa.pub' does not seem to be a valid ssh pubkey file

It looks like two errors; in /home/git/ there's only these files

.gitolite.rc
.bashrc
.bash_profile
.bash_logout

And second (which seems to be the issue), is that the pub_key is not valid. However, according to the git book the file looks alike. I generated it like this:

  1. Installing git in my pc (not the server)

  2. From the git bash:

ssh-keygen.exe
(default path)
(no password)
(no password)

I copied the generated .pub file to the tmp directory on the server via a program named WinSCP.

What I'm I doing wrong? I don't find the answer in google.

PS. If you need more information, please let me know.

like image 660
Roger Avatar asked May 27 '13 16:05

Roger


2 Answers

I also ran into this issue and took a look into the sources of gitolite. The code is basically executing

ssh-keygen -l -f yourFile.pub

to verify wheter the file is a valid ssh-public key... On my machine (OpenWRT router) ssh-keygen wasn't installed. Installing it with:

opkg update
opkg install openssh-keygen

fixed the problem for me.

like image 159
Dietmar Malli Avatar answered Sep 24 '22 16:09

Dietmar Malli


Make sure the /tmp/id_rsa.pub is exactly like the one you have on your PC, in one line, without any ^M at the end of the line (\n only, not \r\n).

And reading the gitolite setup help page, you should name your public key (on the /tmp of the server) with admin's username.

The first time you run it, you need to have a public key file (usually from the admin's workstation) ready.
If the main gitolite admin's username is "alice", this file should be named "alice.pub". Then, as the hosting user, run:

gitolite setup -pk alice.pub
like image 39
VonC Avatar answered Sep 22 '22 16:09

VonC