ollama - ✅(Solved) Fix Linux: multi user permission issue with /tmp [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15130Fetched 2026-04-08 01:48:54
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×1cross-referenced ×1labeled ×1referenced ×1

Root Cause

There are issues where you us ollama launch with one user, which generate 600 files in /tmp/ollama-backup, then if you try to run ollama launch with another user, there is a conflict because the folder is 755 so it can't write to it. The fix is to make that folder more open so any user can write to it.

PR fix notes

PR #15164: fix(fileutil): use user-scoped temp directory for backups

Description (problem / solution / changelog)

On multi-user systems the shared /tmp/ollama-backups directory causes two problems:

  1. Permission conflict: the first user creates the directory with mode 755, so a second user gets EACCES when trying to write their own backup files.
  2. Privacy: backup files (which may contain user configuration) are readable by any local user.

Use os.Getuid() to make each user's backup directory unique, e.g. /tmp/ollama-backups-1000. Set the directory mode to 0700 so only the owning user can access it.

Update tests to call fileutil.BackupDir() instead of reproducing the path construction inline, so they stay in sync with future changes.

Fixes #15130

Changed files

  • cmd/internal/fileutil/files.go (modified, +5/-3)
  • cmd/launch/droid_test.go (modified, +1/-1)
  • cmd/launch/openclaw_test.go (modified, +2/-1)
RAW_BUFFERClick to expand / collapse

What is the issue?

There are issues where you us ollama launch with one user, which generate 600 files in /tmp/ollama-backup, then if you try to run ollama launch with another user, there is a conflict because the folder is 755 so it can't write to it. The fix is to make that folder more open so any user can write to it.

Relevant log output

OS

Linux

GPU

Other

CPU

Intel

Ollama version

0.18.0

extent analysis

Fix Plan

To resolve the issue, we need to modify the permissions of the /tmp/ollama-backup folder to allow any user to write to it.

Step-by-Step Solution

  • Change the permissions of the /tmp/ollama-backup folder to 777 using the following command:
chmod 777 /tmp/ollama-backup
  • Alternatively, you can use the following command to change the ownership of the folder to a specific user or group:
chown -R user:group /tmp/ollama-backup
  • To make the change persistent across reboots, you can add the following line to your /etc/fstab file:
tmpfs   /tmp/ollama-backup    tmpfs   defaults,mode=777 0 0
  • Restart your system or remount the /tmp filesystem to apply the changes:
mount -o remount /tmp

Verification

To verify that the fix worked, try running ollama launch with a different user and check if the files are generated in the /tmp/ollama-backup folder without any permission issues.

Extra Tips

  • Be cautious when changing permissions to 777 as it allows any user to read, write, and execute files in the folder.
  • Consider using a more restrictive permission setting, such as 775, if possible.
  • Make sure to test the changes in a non-production environment before applying them to your production system.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix Linux: multi user permission issue with /tmp [1 pull requests, 1 comments, 2 participants]