简体   繁体   中英

unable to git clone a diffusion repository over ssh

i have setup a phabricator instance with git repository hosting using diffusion in my cloud ubuntu server by following the steps mentioned in both https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/ and https://gist.github.com/sparrc/b4eff48a3e7af8411fc1

i am able to see the repositories in the diffusion part of my phabricator website. i am also able to see the clone ssh URL, but when i try to actually clone the repo from my client, i see the following:

$ git clone ssh://ph-git@pm.example.com:2222/diffusion/GPSCLJ/gps_v1.git gps

Cloning into 'gps'...
Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

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

i have uploaded my public key to my phabricator account

i have other doubts as mentioned in https://gist.github.com/sparrc/b4eff48a3e7af8411fc1#gistcomment-1847168 about the setup in general. /* not replicating the doubts here, because the context for the doubts is in the github gist */

==============================

hey @CEPA thanks for the reply (editing here, because i couldn't format my points if i replied to your comment)

  • i was seeing 2222 in the clone url, because i had done "./bin/config set diffusion.ssh-port 2222" explicitly. after doing "./bin/config delete diffusion.ssh-port" i don't see it anymore
  • however, i do see "git@..." in the clone URL
  • moreover, if i use 2222 in the URL when cloning, it uses my keys (irrespective of whether i use "git@" or not
  • but if i don't use 2222, then it asks for passwd if i use "git@" and fails w/ "please make sure...." error if i don't

From the GitHub thread :

furthermore, I have added public-key on the site for my user, but when doing ssh we use the " git " user. how does this tie up?

It should not "tie up". ssh is looking for your public key in ~/.ssh/authorized-keys . If ~ represents a home's account which never included your public key, you will not have the right to ssh to the remote machine with that account.

Does your clone URL really have the port on there?

Usually when I see clone URLs from Phabricator, they are using the default SSH port (22) and therefore don't need to be be in the clone URL. This means that SSHD is usually setup to watch a different port (like 2222) so when you try to connect to your Phabricator server you would need to specify the port.

You may have set this up differently, but that is how we did it with ours (SSHD -> 2222 and Git -> 22). I hope this helps.

For our diffusion.ssh-port we have it set to empty (defaults to 22). You can set this by going to your Phabricator instance and going to: <Base_URL>/config/edit/diffusion.ssh-port/

For the SSHD setup, we edited /etc/ssh/sshd_config to change port 22 to port 2222 .

It has been a long time since I set this up. As far as I remember, we followed these directions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM