# Private data and wget?

**URL:** <https://discuss.huggingface.co/t/private-data-and-wget/35115>\
**Category:** Beginners\
**Created:** [March 30, 2023, 4:43pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115 "2023-03-30T16:43:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeneralAwareness](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/generalawareness/32/31331_2.png) [@GeneralAwareness](https://discuss.huggingface.co/u/GeneralAwareness)\
**Post date:** [March 30, 2023, 4:43pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/1 "2023-03-30T16:43:01Z")

</div>

I used wget to retrieve data from my space on colab. It worked as long as it was public, but I made it private so it now no longer works. How do I insert a passcode, or PAT as I had to do with github?

edit: Let me add I have tried this but I get invalid user/password (even though the UAT is 100% valid) " [https://USER:\*password\*@huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip](https://USER:*password*@huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip)"

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [April 4, 2023, 4:07pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/2 "2023-04-04T16:07:11Z")

</div>

You need to add the authorization header to `wget`:

```bash
wget --header="Authorization: Bearer <HF_TOKEN>" hf/file/download/url

```

(replace `<HF_TOKEN>` with your HF token)

---

<div class="post-metadata">

**Author:** ![GeneralAwareness](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/generalawareness/32/31331_2.png) [@GeneralAwareness](https://discuss.huggingface.co/u/GeneralAwareness)\
**Post date:** [April 4, 2023, 6:29pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/3 "2023-04-04T18:29:52Z")

</div>

I don’t understand. Instead of the [https://USER](https://USER):xxxxxx/xxxx/xx.zip above, I replace that with --header=“Authorization: Bearer \<HF\_TOKEN\>” then “[https://huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip](https://huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip)” where the HF\_TOKEN is one that I created?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [April 4, 2023, 7:40pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/4 "2023-04-04T19:40:02Z")

</div>

hi @GeneralAwareness here is the command, replace `HF_TOKEN` with a [read token](https://huggingface.co/settings/tokens)

```shell
wget --header="Authorization: Bearer HF_TOKEN" https://huggingface.co/datasets/GeneralAwareness/Various/resolve/main/file.zip

```

---

<div class="post-metadata">

**Author:** ![GeneralAwareness](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/generalawareness/32/31331_2.png) [@GeneralAwareness](https://discuss.huggingface.co/u/GeneralAwareness)\
**Post date:** [April 4, 2023, 8:26pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/5 "2023-04-04T20:26:18Z")

</div>

Good, I did understand afterall.

Thank you everyone.

---

<div class="post-metadata">

**Author:** ![kfahn](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/kfahn/32/14741_2.png) [@kfahn](https://discuss.huggingface.co/u/kfahn)\
**Post date:** [October 23, 2023, 6:43pm UTC](https://discuss.huggingface.co/t/private-data-and-wget/35115/6 "2023-10-23T18:43:59Z")

</div>

I have a follow-up question. I am trying to load some of the ShapeNetCore zip files (I have gotten access) in colab, but using Hugging Face login fails. Another person suggested the above approach. Is there a way to access my token after I login and pass it into the header? I have used .env files in VSC, but not sure of best practices in colab.
