Docs / How-to guides

Share a Folder Read Only

Let someone read your files and nothing else, with the times on the originals left alone.

Use it for

Use a read-only share when the other side needs to look at your files but must not change them. Handing a dataset to a colleague for review, letting an analyst work through a copy of a system, or publishing a folder that several people read and nobody writes.

It is also the simpler mode to run. With no writes coming back there are no conflict copies to resolve and nothing to merge.

Set it up

Two settings, and they belong on different machines.

SettingSet it onWhat it does
share_read_onlyThe machine with the filesRefuses every change arriving from the peer, before anything reaches disk
mount_read_onlyThe machine doing the readingMakes write attempts fail immediately with EROFS

On the machine that holds the files, open the config file and set:

share_read_only = true
scan_shared_on_start = true

scan_shared_on_start announces what is already in your save folder when the session starts, so a folder that is already full appears on the peer without adding each file by hand.

On the machine that will read, set:

mount_read_only = true

Restart both sides and connect as usual. The config file lives at the same relative path on every platform; see the configuration reference for where.

Set both, and know which one is the guarantee. mount_read_only on its own is a local courtesy: it stops your own tools from writing, but the protection lives on the other machine. share_read_only on the machine that owns the files is what actually refuses changes.

Verify it holds

From the reading machine, try to write into the mount. It should fail rather than succeed quietly:

touch ~/KeibiDrop/Mount/test-write
# touch: cannot touch ...: Read-only file system

Then check the originals are untouched. On the machine that holds the files, hash the tree before and after a session:

find ~/KeibiDrop/Received -type f -exec sha256sum {} \; | sort > /tmp/before.txt
# ... let the peer read for a while ...
find ~/KeibiDrop/Received -type f -exec sha256sum {} \; | sort > /tmp/after.txt
diff /tmp/before.txt /tmp/after.txt && echo "unchanged"

On Windows use Get-FileHash in PowerShell for the same check.

Preserve timestamps

Copying a file normally gives the copy a new modification time. When the original times matter, turn on preserve_metadata on the receiving machine:

preserve_metadata = true

Each file, once it is complete on disk, gets the origin's permission bits, modification time and access time applied to it. Verified by tests/integration_preserve_metadata_test.go on both the mount path and the pull path.

On the serving side, a read-only share also avoids updating access times while it serves reads, using O_NOATIME on Linux and a handle sentinel on Windows. The access times on your originals stay as they were.

Limits