Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shares and users

SmbServer::builder()
    .user("alice", "password")
    .share(Share::new("home", backend).user("alice", Access::ReadWrite))

Access

Call on ShareWho gets in
.user(name, Access::ReadWrite)That user, read-write
.user(name, Access::Read)That user, read-only
.public()Anonymous and guest, read-write
.public_read_only()Anonymous and guest, read-only
  • Without .public() or .public_read_only(), only listed users can connect.
  • A public share cannot also list .user() entries; build() fails with PublicMixedWithUsers.

Guest

  • Logging on as guest with an empty password grants anonymous access, unless a user named guest (any case) is configured. macOS Finder sends this for Connect As Guest.
  • Guest and anonymous sessions are neither signed nor encrypted. Clients that require signing cannot establish a guest session.

Per-share switches

All options are enabled by default.

Call on ShareDisables
.leases(false)Leases
.durable_handles(false)Durable handles
.change_notify(false)Change notifications
.named_streams(false)Named streams
.extended_attributes(false)Extended attributes
.server_side_copy(false)Server-side copy
.listed(false)Showing the share in share listings

Other calls on Share:

Call on ShareEffect
.encrypt_data()Require encryption on this share
.remark(text)Comment shown next to the share in listings