[GH-ISSUE #11468] Add Basic Auth (Username & Password) Support to Secure Remote Access #69629

Open
opened 2026-05-04 18:43:09 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ravivarmanr-quantrail on GitHub (Jul 18, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11468

Originally assigned to: @pdevine on GitHub.

Issue Description

Problem
The Ollama CLI doesn't support HTTP Basic Authentication for remote connections.
This makes it difficult to securely share GPU resources with remote users or teammates over the internet.

Current Situation:

This works (proves auth works)

curl -u user:pass https://my-server.com/api/tags
Returns the list of models available on the server.

But this fails when trying to use ollama CLI:

export OLLAMA_HOST= https://my-server.com
ollama list
Error Output :
Error: something went wrong, please see the ollama server logs for details
11:33:43.291 IST HEAD / 401 Unauthorized

This shows that the server is correctly asking for authentication, but the Ollama CLI does not send credentials.

Originally created by @ravivarmanr-quantrail on GitHub (Jul 18, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11468 Originally assigned to: @pdevine on GitHub. ### **Issue Description** **Problem** The Ollama CLI doesn't support HTTP Basic Authentication for remote connections. This makes it difficult to securely share GPU resources with remote users or teammates over the internet. **Current Situation:** #### This works (proves auth works) `curl -u user:pass https://my-server.com/api/tags` Returns the list of models available on the server. #### But this fails when trying to use ollama CLI: `export OLLAMA_HOST= https://my-server.com` `ollama list` Error Output : `Error: something went wrong, please see the ollama server logs for details ` `11:33:43.291 IST HEAD / 401 Unauthorized` This shows that the server is correctly asking for authentication, but the Ollama CLI does not send credentials.
GiteaMirror added the feature request label 2026-05-04 18:43:09 -05:00
Author
Owner

@rick-github commented on GitHub (Jul 18, 2025):

Ollama doesn't do authentication, that's normally handled by a proxy or other auth service. If you want a client that does auth, then you need to roll your own. The ollama cli is just a wrapper for the API, so writing a client that does auth is straightforward.

<!-- gh-comment-id:3089188268 --> @rick-github commented on GitHub (Jul 18, 2025): Ollama doesn't do authentication, that's normally handled by a proxy or other auth service. If you want a client that does auth, then you need to roll your own. The ollama cli is just a wrapper for the API, so writing a client that does auth is straightforward.
Author
Owner

@ravivarmanr-quantrail commented on GitHub (Jul 19, 2025):

Thanks for the clarification. I've raised a PR that adds Basic Auth support to the Ollama CLI using OLLAMA_USERNAME and OLLAMA_PASSWORD environment variables. This should help in scenarios where setting up a proxy isn't ideal.

Ollama doesn't do authentication, that's normally handled by a proxy or other auth service. If you want a client that does auth, then you need to roll your own. The ollama cli is just a wrapper for the API, so writing a client that does auth is straightforward.

<!-- gh-comment-id:3091946194 --> @ravivarmanr-quantrail commented on GitHub (Jul 19, 2025): Thanks for the clarification. I've raised a PR that adds Basic Auth support to the Ollama CLI using OLLAMA_USERNAME and OLLAMA_PASSWORD environment variables. This should help in scenarios where setting up a proxy isn't ideal. > Ollama doesn't do authentication, that's normally handled by a proxy or other auth service. If you want a client that does auth, then you need to roll your own. The ollama cli is just a wrapper for the API, so writing a client that does auth is straightforward.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#69629