shanesmith / gerrit-cli

Gerrit in your command lines.
MIT License
46 stars 19 forks source link

Permission denied (publickey) #29

Open fstefanov opened 5 years ago

fstefanov commented 5 years ago

Hello, looks like I need some help with initial configuration :)

What ssh key is used by default? And where these configs are stored?

gerrit config -a
name = default
host = [ 'localhost' ]
user = [ 'jenkins' ]
port = [ '29418' ]
gerrit clone playground

Cloning project playground from default config into folder playground...
Cloning into 'playground'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
(node:70212) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
gerrit ERROR There was an error running a git command
gerrit ERROR   command: 'clone' '--progress' 'ssh://[ 'jenkins' ]@[ 'localhost' ]:29418/playground.git' 'playground'
gerrit ERROR   output:
gerrit ERROR   error: Cloning into 'playground'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
gerrit ERROR   code: 128
cat ~/.ssh/config

host *localhost*
hostname 192.168.0.10
User jenkins
Port 29418
TCPKeepAlive yes
IdentityFile ~/.ssh/id_rsa
git clone --progress ssh://jenkins@localhost:29418/playground.git

Cloning into 'playground'...
remote: Counting objects: 65, done
remote: Finding sources: 100% (65/65)
remote: Total 68 (delta 22), reused 68 (delta 22)
Receiving objects: 100% (68/68), 7.44 KiB | 0 bytes/s, done.
Resolving deltas: 100% (22/22), done.
Checking connectivity... done.
shanesmith commented 5 years ago

Simply seems like your key pair wasn't registered with the server (which appears to be localhost?)

I wouldn't think that this would be a problem with gerrit-cli, are you able to performa a regular git clone of the project?

fstefanov commented 5 years ago

Yeah i can do regular git clone, but gerrit clone is failing.

torarnv commented 4 years ago

Same problem here:

gerrit --loglevel 10 --verbose --debug ssh git-receive-pack
gerrit ERROR UNKNOWN null@github.com: Permission denied (publickey).