Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Gitea
  3. git clone ssh ask for password

git clone ssh ask for password

Scheduled Pinned Locked Moved Solved Gitea
giteassh
10 Posts 4 Posters 20.3k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hosni6
    wrote on last edited by hosni6
    #1

    Hi everyone,

    I just install gitea, i setup my ssh keys under user settings, when i try to git clone a repo i'm asked to enter a password ...

    c9b98697-6964-4271-96bc-e5f273cab4ed-image.png

    2513d989-4f42-40d5-86fe-4a5880cb8aed-image.png

    i have no specific configuration

    Any help will be welcome. Thanks in advance

    1 Reply Last reply
    1
    • nebulonN Away
      nebulonN Away
      nebulon
      Staff
      wrote on last edited by
      #2

      From the error it appears that the key is not accepted. I just tried to reproduce this, but it works at least on a fresh installation. Can you maybe try to generate a fresh key maybe with the default keygen configs, maybe that specific key is not supported?

      1 Reply Last reply
      0
      • nebulonN nebulon marked this topic as a question on
      • B Offline
        B Offline
        bwag
        wrote on last edited by bwag
        #3

        I am getting this error on a fresh install as well, call it gitea.example.com:

        $ git clone ssh://git@gitea.example.com:29418/user/test-repo.git
        Cloning into 'test-repo'...
        git@gitea.example.com's password: 
        

        I wondered if it's possible the port is wrong, and the command is trying to ssh into the machine as user git, instead of trying to log in. I did try from two different machines with their own ssh keys. I also tried with a verified public key:

        $ git clone ssh://git@gitea.example.com:/user/test-repo.git
        Cloning into 'test-repo'...
        git@gitea.example.com: Permission denied (publickey).
        fatal: Could not read from remote repository.
        
        Please make sure you have the correct access rights
        and the repository exists.
        
        1 Reply Last reply
        0
        • nebulonN Away
          nebulonN Away
          nebulon
          Staff
          wrote on last edited by
          #4

          You probably miss the Host section for your gitea origin in ~/.ssh/config To let git know which ssh key to use.
          This should look something like this:

          Host git.domain.com
              IdentityFile ~/.ssh/id_rsa
              IdentitiesOnly yes
          
          B 1 Reply Last reply
          0
          • nebulonN nebulon

            You probably miss the Host section for your gitea origin in ~/.ssh/config To let git know which ssh key to use.
            This should look something like this:

            Host git.domain.com
                IdentityFile ~/.ssh/id_rsa
                IdentitiesOnly yes
            
            B Offline
            B Offline
            bwag
            wrote on last edited by
            #5

            Hmm, I still get the same behavior after adding that .ssh/config. (Both machines I'm testing from only have one ssh key, if it matters.)

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bwag
              wrote on last edited by
              #6

              I am looking at issues like this (maybe on the wrong track). https://github.com/go-gitea/gitea/issues/11050
              Thank you for any help. Will report back if I find anything.

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                Are you behind Cloudflare maybe? Or some other firewall in the front?

                Usually, the way to debug git ssh issues is like this:

                GIT_SSH_COMMAND="ssh -vvv" git clone ssh://git@gitea.example.com:29418/user/test-repo.git
                

                This will show you what ssh keys of yours it is trying to use.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bwag
                  wrote on last edited by bwag
                  #8

                  Thank you, I have been using that command to debug though without success so far. I am not behind Cloudflare or any firewall.

                  I only have one ssh key on the machines I am using to test. I verified it in the Gitea interface, but it is rejected:

                  $ GIT_SSH_COMMAND="ssh -vvv" git clone ssh://git@gitea.example.com:29418/user/test-repo.git
                  # ...
                  debug1: Next authentication method: publickey
                  debug1: Offering public key: /home/linuxuser/.ssh/id_rsa RSA SHA256:XXXXX explicit agent
                  debug3: send packet: type 50
                  debug2: we sent a publickey packet, wait for reply
                  debug3: receive packet: type 51
                  debug1: Authentications that can continue: publickey,password
                  debug2: we did not send a packet, disable method
                  debug3: authmethod_lookup password
                  # ...
                  

                  I am curious about the difference between these command formats for cloning a repo:

                  git clone ssh://git@gitea.example.com:29418/user/test-repo.git  # Cloudron Gitea
                  git clone git@gitea.example2.com:user/test-repo.git  # non-Cloudron Gitea
                  

                  I also get this difference: with Cloudron,

                  $ ssh -p 29418 git@gitea.example.com
                  git@gitea.cutheory.dev's password:
                  

                  but with non-Cloudron,

                  $ ssh git@gitea.example2.com
                  Hi there, user! You've successfully authenticated with the key named <keyname>, but Gitea does not provide shell access.
                  
                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bwag
                    wrote on last edited by
                    #9

                    Well, I uninstalled and reinstalled the gitea app and I don't reproduce the issue -- cloning now works. Sorry if I've wasted anyone's time. If it happens again, I'll try to diagnose why and report back.

                    1 Reply Last reply
                    0
                    • nebulonN Away
                      nebulonN Away
                      nebulon
                      Staff
                      wrote on last edited by
                      #10

                      Glad it worked out in the end, even if we don't know why.

                      1 Reply Last reply
                      0
                      • nebulonN nebulon has marked this topic as solved on

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search