miru system user and needs specific file system permissions
in the two cases where it touches files on your devices:
- Configs — the agent writes config instances to disk when it deploys a release.
- Data uploads — the agent reads files on the device to upload them to your bucket.
Default permissions
During installation, themiru system user and group are created (no login shell). The
agent process runs as miru:miru under systemd.
By default, the agent creates and owns the following directories:
The first two directories are only for internal use by the agent.
The third directory is the default location for deploying config instances—reading or
writing to any path inside
/srv/miru is supported out-of-the-box, no additional
configuration required.
Configs
When the agent deploys a release, it writes config instances to disk./srv/miru is
the default location and works out-of-the-box — deploying to any path inside /srv/miru
requires no additional configuration. To deploy to a path outside /srv/miru, you must
grant the miru user read and write access to that path.
The Miru Agent supports writing config instances to arbitrary file system paths. Some
examples include:
/etc/myapp/configs/mobility.json/home/myapp/configs/communication.yaml/var/lib/myapp/configs/safety.yaml
miru user access to the specified target path.
Otherwise, the Miru Agent will receive a permission denied error from the operating
system when attempting to write to these file paths.
Required permissions
To write to a given file, themiru user requires specific permissions to
- The file itself
- The directories along the path to the file
/var/lib/myapp/configs/planning.yaml as an example. The
required read and write permissions to grant the miru user access to this file are
shown in the table below.
To write to a given file, the
miru user requires the following Unix permissions:
-
Read (
r) and write (w) access to the file itselfr(read) is required to read the file contents.w(write) is required to write the file contents.
If the file does not yet exist, you can ignore this permission. The agent will create it with the appropriate permissions. -
Read (
r), write (w), and execute (x) access to the file’s parent directoryr(read) is required to scan files within the directory.w(write) is required to create/replace directory entries (e.g., temp file + rename for atomic writes).x(execute/search) is required to access files within the directory.
-
Execute (
x) access to all directories along the path to the filex(execute) is required to access directories within the path to the file.
Many directories, such as/var/lib, are world-readable by default and need no special permissions. Other directories, such as/home/myapp, will not grantmiruuser access by default and must be specifically configured.
Data uploads
To upload data, the agent reads the files matched by an upload rule’ssource.glob and streams them to
your bucket. The miru user needs read access to the files themselves, read and execute
on the directory that contains them (to list and match the glob), and execute access to
traverse the remaining directories along the path.
Required permissions
To read a file for upload, themiru user requires specific permissions to
- The file itself
- The directories along the path to the file
source.glob is /var/log/robot/*.log, matching the
file /var/log/robot/app.log. The required permissions to grant the miru user access
to this file are shown in the table below.
To read a given file, the
miru user requires the following Unix permissions:
-
Read (
r) access to the file itselfr(read) is required to read the file contents for upload.
-
Read (
r) and execute (x) access to the file’s parent directoryr(read) is required to list the directory and match files against the glob.x(execute/search) is required to open files within the directory.
-
Execute (
x) access to all directories along the path to the filex(execute) is required to traverse directories within the path to the file.
Many directories, such as/var/log, are world-readable and executable by default and need no special permissions. Others, such as/home/myapp, will not grantmiruuser access by default and must be specifically configured.
miru user does not need write access to the source
files, unless you delete them after upload, covered next.
Deleting after upload
If an upload rule’sdestination.delete_policy
is after_upload, the agent removes each file after a successful upload. Deleting a file
requires write (w) access to its parent directory (to remove the directory
entry), so grant the miru user r, w, and x on the directory in that case:
Testing access
To help you navigate the necessary permissions, we’ve provided an automated script that reports any gaps in the permissions for themiru user to access a given file or
directory.
The check runs in one of three modes, matching the two cases above. They differ only in
the write (w) requirements — read and execute requirements are the same in every mode:
--mode write(default) — Configs: deploying config instances. Requiresr,won the file andr,w,xon the parent directory.--mode read-delete— Data uploads withdelete_policy: after_upload. Requiresron the file andr,w,xon the parent (deleting needs write on the parent, not the file).--mode read-only— Data uploads without delete. Requiresron the file andr,xon the parent directory.
Run the script
First, download the script to your current working directory usingcurl.
less.
You can also view the script on GitHub.
write (the config case), so it can be omitted there.
Understand the output
The script outputs a table of the permissions required to access the target path. Each row shows a path unit (file, directory, parent, ancestor) and required
permissions.
-means that permission is not required for that path unitOKmeans the required permission is presentNOmeans the required permission is missing
FINAL RESULT: PASS or FINAL RESULT: FAIL.
Example outputs
The examples below show the defaultwrite (Configs) mode.
- Existing File
- File doesn't exist
- Directory
To test an existing file, run the script with the file path as an argument.
Granting access
Once you’ve determined the necessary permissions, you need to grant them to themiru
user. There are two common methods for granting the miru user access to a given path:
- Standard Unix permissions - basic owner/group/other mode bits on a file or directory
- ACLs - per-user or per-group access rules beyond mode bits
miru user or group the
required permissions.
Standard Unix permissions
For standard Unix permissions, there are three approaches, in order of preference:- Add
miruto a group that already has access - Grant the
mirugroup the appropriate permissions - Transfer ownership to the
miruuser
miru to that group is the least
invasive option.
We recommend starting there. Otherwise, grant the miru group access directly.
Add miru to an existing group
Add themiru user to a group that already has the required access, so it inherits that
group’s permissions without touching the path:
Set the group or owner
If no group already grants the access you need, set the path’s group tomiru
(recommended) or transfer ownership to miru.
Files
- Group access
- Transfer ownership
- Group access
- Transfer ownership
ACLs
When you cannot change the ownership or the group of a path (e.g., a directory shared between multiple services), use POSIX Access Control Lists (ACLs) for fine-grained permission control. ACLs require theacl package. If setfacl is not available, install it with:
miru user read and write access to a file.
miru user read/write/execute access to a directory.

