1

Hi i have this codebase account and i want to clone it to in my certain folder. I already added the SSH public keys in my profile in codebase. When i tried to git clone then certain path of the project this is what it goes

Cloning into 'website'... Permission denied (publickey). fatal: Could not read from remote repository.

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

can someone help me figured this out why it says Permisssion denied(public key)?? I already added my SSH public key to my profile in my account in codebase. Any help is muchly appreciated.

maco
  • 27
  • 1
  • 3
  • 8

1 Answers1

1

Make sure that:

  • your ssh access does work:

    ssh -T git@codebasehq.com
    

For that, you need %HOME%\.ssh\id_rsa(.pub) files: those are the default names used by git.

  • you are cloning using an url like:

    git clone git@codebasehq.com:account/project/repo.git
    
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • i tried the ssh -T git@codebasehq.com and this is what it goes Permission denied (publickey). – maco Aug 03 '14 at 05:29
  • @macomiro so that is what you need to resolve first: make sure your public key has been copied as one line in your codebashq account. Then, on the client side, what OS are you using? What git version? – VonC Aug 03 '14 at 05:34
  • yes i already added my public key in my codebasehq account and im using windows here and my git version is git-gui version 0.19.GITGUI git version 1.9.4.mysysgit.0 i think that is the version of my git – maco Aug 03 '14 at 05:37
  • @macomiro make sure it was added as one line (not two separate lines) – VonC Aug 03 '14 at 05:37
  • @macomiro then, on Windows: set `GIT_SSH` (http://stackoverflow.com/a/19534485/6309), make sure `HOME` environment variable is defined, and that `%HOME%\.ssh\id_rsa(.pub)` files exist. – VonC Aug 03 '14 at 05:41
  • yes my public key is not in two separate lines i added to my profile in the textarea field – maco Aug 03 '14 at 06:33
  • ive seen the id_rsa(.pub) file in my users m .ssh folder am i gonna copy this file then paste it to my respective folder? – maco Aug 03 '14 at 06:37
  • @macomiro why did you accept the answer? Is it working? Don't accept it if it isn't working yet. – VonC Aug 03 '14 at 06:38
  • @macomiro you need to make sure that, in your current shell session, HOME is defined to reference (by default) `C:\Users\yourLogin`. In that case, no need to copy. Which allows git to find your keys where it expects it: `%HOME%\.ssh\id_rsa(.pub)` – VonC Aug 03 '14 at 06:39
  • ok i cancel the accept answer first. in my git i target it to my test folder and there is a test.pub file – maco Aug 03 '14 at 06:41
  • @macomiro what `set HOME` returns? What do you see in `dir %HOME%\.ssh`? Yo ucan edit your question with those information. – VonC Aug 03 '14 at 06:42
  • where will i find that? ahmmm my git target folder is xampp/htdocs/soomedia_test then inside of that folder i have a soomedia_test.pub file and that soomedia_test.pub when i opened that file i copy that ssh rsa then paste to my ssh public key to my profile account in codebasehq.com – maco Aug 03 '14 at 06:44
  • am i gonna use the id_rsa.pub file? not my soomedia_test.pub file? – maco Aug 03 '14 at 06:48
  • i already figured it out im using the id_rsa.pub file not my soomedia_test.pub file and it works now! thanks a lot for helping men! – maco Aug 03 '14 at 06:51
  • @macomiro id_rsa.pub is the default name. If you were to use a different name for your public/private keys, you would need a config file. – VonC Aug 03 '14 at 06:52
  • @macomiro great. I have included the default names in the answer for more visibility. Now, you can accept it ;) – VonC Aug 03 '14 at 06:53
  • thanks for the help i copy the id_rsa.pub file from the .ssh folder then paste it to my soomedia_test folder the id_rsa.pub file then change the public key using the id_rsa.pub file and it works! – maco Aug 03 '14 at 06:56