Permission denied when attempting to clone from fresh Gerrit site.

1,001 views
Skip to first unread message

Khai Do

unread,
Jun 25, 2014, 12:52:11 PM6/25/14
to repo-d...@googlegroups.com
Hello.  I just built gerrit from master created a gerrit site setup a user account but was not able to git clone a repo.  I get a Permission denied (publickey) error.  I have done this many times before without problems, but today it's not working.  Has anyone else seen this?

steps to repro:
1. built gerrit from master
2. java -jar buck-out/gen/gerrit.war init --no-auto-start --debug --batch -d gerrit_testsite
3. changed 'auth' in gerrit.config to use 'type = DEVELOPMENT_BECOME_ANY_ACCOUNT'
4. gerrit_testsite/bin/gerrit.sh start
5. goto http://localhost:8080 to setup a new account. Entered name, email, username, ssh-key
6. clone the repo..

~/temp$ git clone ssh://localhost:29418/All-Projects
Cloning into 'All-Projects'...
The authenticity of host '[localhost]:29418 ([::1]:29418)' can't be established.
RSA key fingerprint is f5:65:65:0d:22:43:ba:8d:38:a6:8e:65:9d:40:5d:c7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:29418' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Khai Do

unread,
Jun 25, 2014, 1:55:35 PM6/25/14
to repo-d...@googlegroups.com
The access denied error goes away if the gerrit account I create in step #5 matches my local user account.  What I typically do is create a test account on gerrit (which isn't the same as my local account) then I add a '[user]' section (name and email) to my .gitconfig and gerrit.config files to specify the test account.  Doing that used to allow me to clone/push with the test account, but that no longer works.  Anybody know why?  I'm not sure if new behavior is by design or if it's a bug.

Jonathan Nieder

unread,
Jun 25, 2014, 1:56:59 PM6/25/14
to Khai Do, repo-d...@googlegroups.com
For authentication, what matters is the username in the ssh://username@host URL, not the user identity in ~/.gitconfig.


On Wed Jun 25 2014 at 10:55:39 AM, Khai Do <zaro...@gmail.com> wrote:
The access denied error goes away if the gerrit account I create in step #5 matches my local user account.  What I typically do is create a test account on gerrit (which isn't the same as my local account) then I add a '[user]' section (name and email) to my .gitconfig and gerrit.config files to specify the test account.  Doing that used to allow me to clone/push with the test account, but that no longer works.  Anybody know why?  I'm not sure if new behavior is by design or if it's a bug.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Khai Do

unread,
Jun 25, 2014, 1:59:32 PM6/25/14
to repo-d...@googlegroups.com, zaro...@gmail.com
Duhh! you are right. I forgot to specify the test account's username in ssh protocal.  Thanks!
Reply all
Reply to author
Forward
0 new messages