# How to login to Huggingface Hub with Access Token

> Source: <https://discuss.huggingface.co/t/how-to-login-to-huggingface-hub-with-access-token/22498?page=3#post_43>
> Published: 2026-12-02 05:30:45+00:00

**Recommendation:** When CLI login shows the wrong Hugging Face account, check the `HF_TOKEN` environment variable first because it overrides the saved token, then inspect `~/.netrc` for an old entry before deleting it.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

This worked for me, thank you so much for coming here to to tell us.

 
 
I had this same issue. I was using

hf auth login –add-to-git-credential –token 

it wasn’t the paste issue for me, but rather that I still had a

~/.netrc

rm ~/.netrc then tried to login again and it worked

 
 
Run `hf auth login` and choose “Paste an access token.” If nothing shows up when you paste, that’s normal. Press Enter, then run `hf auth whoami` to check which account you’re logged in as.

If it shows the wrong account, check whether `HF_TOKEN` is set. It takes precedence over the saved token. If you suspect `~/.netrc`, check for an old Hugging Face entry first. The file may also contain credentials for other services.
