[PR #11574] server: add authorized_keys file #13586

Open
opened 2026-04-13 00:30:40 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11574

State: open
Merged: No


This change adds an "authorized_keys" file similar to sshd which can control access to an Ollama server. The file itself is very simple and consists of various entries for Ollama public keys.

The format is:

[,...]

Examples:

ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob /api/tags,/api/ps,/api/show,/api/generate,/api/chat

Use the "*" wildcard symbol to substitute any value, e.g.:

To grant full access to "bob":

ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob *

To allow all callers to view tags (i.e. "ollama ls"):

* * * /api/tags
  • The key format must be set to "ssh-ed25519" or set to the wildcard character.
  • The public key must be an ssh based ed25519 (Ollama) public key or set to the wildcard character.
  • Name can be any string you wish to associate with the public key. Note that if a public key is used in more than one entry in the file, the first instance of the name will be used and subsequent name values will be ignored.
  • Endpoints is a comma separated list of Ollama Server API endpoints or the wildcard character. The HTTP method is not currently needed, but could be added in the future.
**Original Pull Request:** https://github.com/ollama/ollama/pull/11574 **State:** open **Merged:** No --- This change adds an "authorized_keys" file similar to sshd which can control access to an Ollama server. The file itself is very simple and consists of various entries for Ollama public keys. The format is: <key format> <public key> <name> [<endpoint>,...] Examples: ``` ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob /api/tags,/api/ps,/api/show,/api/generate,/api/chat ``` Use the "*" wildcard symbol to substitute any value, e.g.: To grant full access to "bob": ``` ssh-ed25519 AAAAC3NzaC1lZDI1NT... bob * ``` To allow all callers to view tags (i.e. "ollama ls"): ``` * * * /api/tags ``` - The key format must be set to "ssh-ed25519" or set to the wildcard character. - The public key must be an ssh based ed25519 (Ollama) public key or set to the wildcard character. - Name can be any string you wish to associate with the public key. Note that if a public key is used in more than one entry in the file, the first instance of the name will be used and subsequent name values will be ignored. - Endpoints is a comma separated list of Ollama Server API endpoints or the wildcard character. The HTTP method is not currently needed, but could be added in the future.
GiteaMirror added the pull-request label 2026-04-13 00:30:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13586