# Git@hf.co: Permission denied (publickey)

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%3E%5C
**Category:** Beginners\
**Created:** [May 25, 2024, 3:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452 "2024-05-25T15:32:40Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenshinn](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kenshinn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkenshinn)%5C
**Post date:** [May 25, 2024, 3:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F1 "2024-05-25T15:32:40Z")

</div>

I am having trouble authenticating with my SSH key when trying to access a Hugging Face Git repository. When I attempt to connect, I receive the following error message:

```auto
git@hf.co: Permission denied (publickey).

```

I have provided more detailed debug information of `ssh -vvvT git@hf.co` below:

```auto
debug1: Next authentication method: publickey
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: /Users/kenshin/.ssh/hf_id ED25519 SHA256:P0dAH1Z2UlBk...q8eLtjxg4 explicit agent
debug1: Offering public key: /Users/kenshin/.ssh/hf_id ED25519 SHA256:P0dAH1Z2UlBk...q8eLtjxg4 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
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
git@hf.co: Permission denied (publickey).

```

I have verified that:

1. My private key has not been corrupted or modified.
2. I have added public key to my ssh account.
3. I have tried generating new key pairs several times.
4. My network works fine.

Despite these checks, I am still unable to authenticate successfully. I would greatly appreciate any assistance or guidance you can provide to help me resolve this issue. Please let me know if you need any additional information.

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![namakilam](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/namakilam/32/27364_2.png) [@namakilam](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnamakilam)%5C
**Post date:** [May 26, 2024, 6:31am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F2 "2024-05-26T06:31:36Z")

</div>

I am facing the same error since yesterday. Did you get any support?

---

<div class="post-metadata">

**Author:** ![naveed-workhub](https://avatars.discourse-cdn.com/v4/letter/n/a698b9/32.png) [@naveed-workhub](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnaveed-workhub)%5C
**Post date:** [May 26, 2024, 6:46am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F3 "2024-05-26T06:46:38Z")

</div>

Indeed, it seems there is some problem on hugging face end, I am also facing the same issue since yesterday, checked everything, is there any official hugging face channel where we can report this issue other than this forum ?

---

<div class="post-metadata">

**Author:** ![ggfg1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@ggfg1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fggfg1)%5C
**Post date:** [May 26, 2024, 7:31am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F4 "2024-05-26T07:31:28Z")

</div>

I am using almost the same way on Github without any problem,  
but it just doesn’t work on Huggingface

---

<div class="post-metadata">

**Author:** ![iliyanv](https://avatars.discourse-cdn.com/v4/letter/i/50afbb/32.png) [@iliyanv](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Filiyanv)%5C
**Post date:** [May 26, 2024, 10:15am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F5 "2024-05-26T10:15:36Z")

</div>

Same here, I even re-created my SSH key at the peak of the denial phase.

---

<div class="post-metadata">

**Author:** ![hi-melnikov](https://avatars.discourse-cdn.com/v4/letter/h/db5fbb/32.png) [@hi-melnikov](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fhi-melnikov)%5C
**Post date:** [May 26, 2024, 12:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F6 "2024-05-26T12:03:02Z")

</div>

Also have this trouble since yesterday

---

<div class="post-metadata">

**Author:** ![naveed-workhub](https://avatars.discourse-cdn.com/v4/letter/n/a698b9/32.png) [@naveed-workhub](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnaveed-workhub)%5C
**Post date:** [May 26, 2024, 12:12pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F7 "2024-05-26T12:12:33Z")

</div>

any one have the luck to find any solution for this?

---

<div class="post-metadata">

**Author:** ![nick-ma](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nick-ma/32/27422_2.png) [@nick-ma](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnick-ma)%5C
**Post date:** [May 26, 2024, 10:33pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F8 "2024-05-26T22:33:39Z")

</div>

same issue here. I use the same ssk key pari on github which works fine.

---

<div class="post-metadata">

**Author:** ![JR818](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jr818/32/27433_2.png) [@JR818](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJR818)%5C
**Post date:** [May 27, 2024, 4:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F9 "2024-05-27T04:56:20Z")

</div>

same issue here

---

<div class="post-metadata">

**Author:** ![wok000](https://avatars.discourse-cdn.com/v4/letter/w/85e7bf/32.png) [@wok000](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fwok000)%5C
**Post date:** [May 27, 2024, 7:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F10 "2024-05-27T07:24:59Z")

</div>

same issue here

---

<div class="post-metadata">

**Author:** ![naveed-workhub](https://avatars.discourse-cdn.com/v4/letter/n/a698b9/32.png) [@naveed-workhub](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnaveed-workhub)%5C
**Post date:** [May 27, 2024, 9:31am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F11 "2024-05-27T09:31:08Z")

</div>

i believe its fixed now, working fine for me.

---

<div class="post-metadata">

**Author:** ![not-lain](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/not-lain/32/59092_2.png) [@not-lain](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fnot-lain)%5C
**Post date:** [May 27, 2024, 11:50am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F12 "2024-05-27T11:50:16Z")

</div>

@kenshinn I believe it has been fixed by now, can you retry and confirm if it works on your side ?

---

<div class="post-metadata">

**Author:** ![ggfg1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@ggfg1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fggfg1)%5C
**Post date:** [May 27, 2024, 12:05pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F13 "2024-05-27T12:05:47Z")

</div>

Now, it works successfully

---

<div class="post-metadata">

**Author:** ![kenshinn](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kenshinn](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkenshinn)%5C
**Post date:** [May 27, 2024, 12:57pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F14 "2024-05-27T12:57:24Z")

</div>

yes! it works fine now

---

<div class="post-metadata">

**Author:** ![ComNguoi](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/comnguoi/32/33025_2.png) [@ComNguoi](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FComNguoi)%5C
**Post date:** [October 16, 2024, 7:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F15 "2024-10-16T19:38:57Z")

</div>

I got this error when I use the git clone command in Window Command Prompt, but using the command with the Git Bash works just fine. Hope this will help someone out there.

---

<div class="post-metadata">

**Author:** ![meschg](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/meschg/32/42268_2.png) [@meschg](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmeschg)%5C
**Post date:** [March 1, 2025, 4:31pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F16 "2025-03-01T16:31:26Z")

</div>

Hi, just now also had this issue on Win 11 with Powershell.  
Udapting GIT to the newest Version and using GIT-Bash resolved it.

---

<div class="post-metadata">

**Author:** ![rzgar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rzgar/32/43049_2.png) [@rzgar](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frzgar)%5C
**Post date:** [March 11, 2025, 8:42pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F17 "2025-03-11T20:42:39Z")

</div>

Make sure the SSH-Agent is running:  
_powershell_

```auto
sc config ssh-agent start=auto
sc start ssh-agent

```

Add the private key:

```auto
ssh-add %USERPROFILE%\.ssh\id_rsa

```

Edit or create the file “C:/Users/YOUR\_USER\_NAME/.ssh/config”:

```auto
Host hf.co
    HostName hf.co
    User git
    IdentityFile C:\Users\YOUR_USER_NAME\.ssh\YOUR_PRIVATE_KEY

```

Then run

```auto
git clone git@hf.co:datasets/USERNAME/YOUR_REPO_NAME
"Example: git clone git@hf.co:datasets/rzgar/ckb_wikipedia_kurdish_sorani_urls"

```

If your key is protected by a passphrase, use **Git Bash** , and remember that the passphrase is session-specific. Once you close the terminal, you will need to add the key again:

```auto
ssh-add "C:\Users\YOUR_USER_NAME\.ssh\YOUR_PRIVATE_KEY"

```

For a permanent solution, remove the passphrase (less secure).

---

<div class="post-metadata">

**Author:** ![atticusmatticus](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@atticusmatticus](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fatticusmatticus)%5C
**Post date:** [August 21, 2025, 7:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F18 "2025-08-21T19:09:15Z")

</div>

This is still broken or broken again. I’ve tried with multiple keys. I have the exact same setup working on Github for cloning with SSH. I can replicate this on multiple computers so must be a HF thing.

An added piece of information. When I run `ssh -T git@hf.co` I get:

```auto
Hi anonymous, welcome to Hugging Face.

```

I have my name in there so I shouldn’t be getting ‘anonymous’.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [August 22, 2025, 1:08am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-hf-co-permission-denied-publickey%2F88452%2F19 "2025-08-22T01:08:41Z")

</div>

### Related resources

- [Git over SSH](https://huggingface.co/docs/hub/en/security-git-ssh)
- [Added my SSH key, cannot push to Spaces repo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fadded-my-ssh-key-cannot-push-to-spaces-repo%2F131631)
- [Unable to clone repository via ssh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-clone-repository-via-ssh%2F79478)
