KSMBD.CONF(5)
π ksmbd.conf β the config file for ksmbd.mountd π
okay bestie, gather round, because this is the manpage for ksmbd.conf in section 5 (File Formats and Conventions), and it's a chonky one. we're doing this together. part one. let's go π«Ά
β¨ NAME β¨
ksmbd.conf β the configuration file for ksmbd.mountd
πΈ DESCRIPTION πΈ
ksmbd.conf is the configuration file for the ksmbd.mountd(8) user mode daemon. like, this is where all the server's settings live. periodt.
you can hand-edit it (iconic behaviour), but there's also ksmbd.addshare(8), which is the tool for configuring shares in ksmbd.conf. heads up though: ksmbd.addshare modifies ksmbd.conf such that its existing formatting is not retained. so if you spent an hour aligning your equal signs for the aestheticβ¦ yeah, it's gone. π
the good news? ksmbd.addshare notifies ksmbd.mountd of changes, if it had made any, by sending the SIGHUP signal to ksmbd.mountd. and changes made with ksmbd.addshare will never require restarting ksmbd.mountd and ksmbd to take effect. no restart era, we love to see it. π
if you're not using ksmbd.addshare, you can still ping the daemon about your changes with ksmbd.control --reload.
by default, ksmbd.conf is expected to be at /etc/ksmbd/ksmbd.conf. and there's a whole example file chilling at /etc/ksmbd/ksmbd.conf.example if you want to peek at what a real one looks like. π
π FILE FORMAT π
okay so the structure is genuinely not that deep, i promise.
ksmbd.conf is made of sections (aka groups), and each section marks the end of the one before it. a section starts with the section name wrapped in brackets ([]), followed by a newline. π
a section can contain parameters separated by newlines. a parameter is a name (aka a key) and a value, in that order, separated by an equal sign (=).
here's the fine print, and yes it matters:
- a name may contain leading and trailing tabs and spaces.
- a value begins immediately after the equal sign, and it may contain leading tabs and spaces, or be empty.
- a value may be a list of multiple values separated by commas, tabs, and spaces.
- for a list of users: to give all the users in a system group, you give the group name prefixed with an at (
@). - a value may have a number suffix, which is either
K,M,G,T,P, orE. - a semicolon (
;) or a hash (#) marks the beginning of a comment, and that comment continues until the end of the line. - if a section has the same name as a previous section, it's a continuation of that previous section β like, they're literally the same section. no cap.
- a duplicate parameter in a section has its value updated only if its previous value was empty. so first-nonempty-wins energy. π
π¦ SHARES π¦
every section name, except the one for the global section, defines a shared resource β commonly called a share. yes bestie, that's the whole point of this file.
the section name is the share name, and it has rules:
- it must be UTF-8
- it must be
[1, 64)bytes - it is case-insensitive
users that may be allowed to connect to a share are those present in the ksmbdpwd.db(5) user database. a share may also limit which users are allowed to connect to it (more on that in the parameters, we'll get there π).
when a user connects to a share, they get mapped to a system user, and the underlying filesystem permissions are enforced. by default that mapping is done by name β but it can also be done by mapping all users connected to the share onto a single system user and group.
and if someone connects as a user who isn't in the user database? only guest sessions may work. that's the vibe check.
π PARAMETERS π
before we dive into the list, here's the legend, because the letters actually mean something:
- Share parameters, marked below with (S), can be given in any section. when given in a section that isn't global, it's specific to that particular share. when given under the global section, it sets the default value for all shares.
- Global parameters, marked below with (G), can only be given in the global section, and they control functionality that applies to the server.
π¨ real talk: changes to global parameters apply only after restartingksmbd.mountdandksmbd. no SIGHUP shortcut for those, sorry bestie.
aapl model(G) β the model string sent in the SMB2 AAPL extension's server-capabilities response. macOS uses it to pick a Finder icon for the server (for example,Xservegets you a rack-server icon π₯οΈ). only relevant to shares withtime machine = yes. Default:aapl model = Xservebind interfaces only(G) β only bind to the interfaces given withinterfaces. Default:bind interfaces only = nobrowseable(S) β the share shows up in a net view and in the browse list. Default:browseable = yescomment(S) β the description of the share, as seen in a net view and and in the browse list. Default:comment =create mask(S) β octal bitmask that gets bitwise ANDed with DOS-to-UNIX-mapped permissions when creating a file. Default:create mask = 0744crossmnt(S) β allow path lookup to cross a mountpoint to the root of a different filesystem. Default:crossmnt = yesdeadtime(G) β the number of minutes of inactivity before a connection is considered dead, and is then terminated. it will not be terminated if it has any open files. withdeadtime = 0, no connection is considered dead due to inactivity. Default:deadtime = 0directory mask(S) β octal bitmask that gets bitwise ANDed with DOS-to-UNIX-mapped permissions when creating a directory. Default:directory mask = 0755durable handles(G) β can grant SMB2 durable file handles on a share. Default:durable handles = nofollow symlinks(S) β setting this parameter allows any file or directory that is a symbolic link to be followed. but ngl, this option does not allow following a symbolic link to/etc/passwdin their home directory. so don't get any ideas. π ββοΈ Default:follow symlinks = noforce create mode(S) β octal bitmask that gets bitwise ORed after the bitmask given withcreate maskis applied. Default:force create mode = 0000force directory mode(S) β octal bitmask that gets bitwise ORed after the bitmask given withdirectory maskis applied. Default:force directory mode = 0000force group(S) β the system group that all users connected to the share are mapped to. Default:force group =force user(S) β the system user that all users connected to the share are mapped to. withforce group =, the primary group of the system user is the respective system group. Default:force user =guest account(G) β the user that does not require a password when connecting to any share withguest ok = yes. when connecting to such a share with the user left empty, this parameter decides which system user to map to. Default:guest account = nobodyguest account(S) β the user that does not require a password when connecting to the share withguest ok = yesgiven. Default:guest account =guest ok(S) β allow passwordless connections to the share as the user given withguest account, and with the user left empty. Default:guest ok = nohide dot files(S) β files starting with a dot appear as hidden files. Default:hide dot files = yeshide unreadable(S) β directory entries are hidden unless the connected user has read data, read extended attributes, and read attributes access. Default:hide unreadable = noinherit owner(S) β ownership for new files and directories is controlled by the ownership of the parent directory. Default:inherit owner = nointerfaces(G) β list of the interfaces that are listened to, withbind interfaces only = yesgiven. Default:interfaces =invalid users(S) β list of the users that are disallowed from connecting to the share. a user being in the list has precedence over that user being invalid users. withinvalid users =, no user is disallowed. Default:invalid users =ipc timeout(G) β the number of seconds user space has to reply to a heartbeat frame. if that's exceeded, all sessions and TCP connections will be closed. withipc timeout = 0, user space can reply whenever. Default:ipc timeout = 0kerberos keytab file(G) β the path of the keytab file for the service principal. if no value is given, it's the default keytab resolved withkrb5_kt_default(3). Default:kerberos keytab file =kerberos service name(G) β the service principal name. if no value is given, it'scifs/followed by the FQDN resolved withgetaddrinfo(3). Default:kerberos service name =kerberos support(G) β support for Kerberos 5 authentication. for this parameter to actually take effect,ksmbd.mountdmust be built against Kerberos 5. (iykyk π₯) Default:kerberos support = nomap to guest(G) β when to map a user to the user given withguest account. withmap to guest = bad user, it maps when the user does not exist. Default:map to guest = nevermax active sessions(G) β maximum number of simultaneous sessions to all shares. Default:max active sessions = 1024max connections(G) β maximum number of simultaneous connections to the server. withmax connections = 0, the value will be set to the maximum allowed number of65536. number suffixes are allowed. Default:max connections = 128max connections(S) β maximum number of simultaneous connections to the share. withmax connections = 0, the value will be set to the maximum allowed number of65536. number suffixes are allowed. Default:max connections = 128max ip connections(G) β maximum number of connections to the server per IP address. withmax ip connections = 0, the value will be set to the maximum allowed number of65536. number suffixes are allowed. Default:max ip connections = 8max open files(G) β maximum number of simultaneous open files for a client. Default:max open files = 10000netbios name(G) β the NetBIOS name. Default:netbios name = KSMBD SERVERoplocks(S) β issue oplocks to file open requests on the share. Default:oplocks = yespath(S) β the path of the directory that users connected to the share are given access to. Default:path =read list(S) β list of the users that are allowed read-only access to the share. a user being in the list has precedence overread only = noor that user being inwrite list. Default:read list =read only(S) β users are allowed read-only access to the share. withread only = no, the effect is the same as withwritable = yes. this parameter has precedence overwritable,writeable, andwrite ok. Default:read only = ; yesrestrict anonymous(G) β how to restrict connections to any share as the user given withguest account. withrestrict anonymous = 1orrestrict anonymous = 2, it disallows connections to theIPC$share and any share that givesguest ok = no. Default:restrict anonymous = 0
and that, bestie, is only part one π the parameter list is nowhere near done, so don't you dare close the tab β keep scrolling, we're so back π β¨
Alright, the parameter parade continues β headphones on, no skipping, we're doing every single one of these π
root directory(G) β the path of the directory that gets prepended to the path of every share. It's givingchroot(2)but make it SMB. Lowkey a big deal. Default:root directory =server max protocol(G) β the maximum protocol version we're willing to speak. Default:server max protocol = SMB3_11server min protocol(G) β the minimum protocol version we'll tolerate. Anything older gets ghosted. Default:server min protocol = SMB2_10server multi channel support(G) β whether SMB3 multi-channel is supported. Default:server multi channel support = noserver signing(G) β is the client allowed or required to use SMB2 signing? Withserver signing = disabledorserver signing = auto, SMB2 signing is allowed if it's requested by the client. Withserver signing = mandatory, SMB2 signing is required, periodt. Default:server signing = autoserver string(G) β the string that shows up in browse lists right next to the machine name. Your little name tag β¨ Default:server string = SMB SERVERshare:fake_fscaps(G) β a decimal bitmask that gets bitwise ORed with the filesystem capability flags so we can fake them. Withshare:fake_fscaps = 64, theFILE_SUPPORTS_SPARSE_FILESflag is set. Default:share:fake_fscaps = 64smb2 leases(G) β negotiate SMB2 leases on file open requests. Default:smb2 leases = yessmb2 max credits(G) β the maximum number of outstanding simultaneous SMB2 operations. Number suffixes are allowed. Default:smb2 max credits = 8192smb2 max read(G) β the maximum length that may be used in an SMB2 READ request sent by a client. Number suffixes are allowed. Default:smb2 max read = 4MBsmb2 max trans(G) β the maximum buffer size a client may use in a sent SET_INFO request, or in a received QUERY_INFO, QUERY_DIRECTORY, or CHANGE_NOTIFY response. Number suffixes are allowed. Default:smb2 max trans = 1MBsmb2 max write(G) β the maximum length that may be used in an SMB2 WRITE request sent by a client. Number suffixes are allowed. Default:smb2 max write = 4MBsmb3 encryption(G) β is the client disallowed, allowed, or required to use SMB3 encryption? Withsmb3 encryption = disabled, SMB3 encryption is disallowed even if the client asks for it. Withsmb3 encryption = auto, it's allowed if the client requests it. Withsmb3 encryption = mandatory, encryption is required β meaning clients that don't support encryption get denied access to all shares π no exceptions. Default:smb3 encryption = autosmbd max io size(G) β the maximum read/write size of SMB-Direct. Number suffixes are allowed. Default:smbd max io size = 8MBstore dos attributes(S) β store DOS attributes using xattr, and then use them in the DOS-to-UNIX-mapping of permissions. Default:store dos attributes = yestcp port(G) β the TCP port we're listening to. Default:tcp port = 445time machine(S) β advertise the share as an Apple Time Machine backup target via the SMB2 AAPL extension. macOS stores Apple metadata such ascom.apple.FinderInfoas named data streams, so the share also needsvfs objects = streams_xattrfor it to work correctly β this option does not enable that on its own. macOS also requires the globaldurable handles = yesandsmb2 leases = yesto reconnect a Time Machine destination after a network interruption; without them, macOS refuses to configure the backup destination's reconnect settings. Default:time machine = novalid users(S) β the list of users that are allowed to connect to the share. Withvalid users =, all users are allowed. Default:valid users =veto files(S) β names of files and directories that get made invisible and inaccessible. Names go between forward slashes (/), e.g.veto files = /foo/bar/makes files and directories namedfooandbarinvisible and inaccessible. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. Default:veto files =vfs objects(S) β the list of VFS modules to overload I/O operations with. The available VFS modules areacl_xattrandstreams_xattr. Default:vfs objects =workgroup(G) β the workgroup the server will appear to be in when clients query it. Default:workgroup = WORKGROUPwritable(S) β users get read-write access to the share. Withwritable = yes, the effect is the same asread only = no. This parameter has precedence overwriteable, andwrite ok. Default:writable =writeable(S) β same effect aswritable. This parameter has precedence overwrite ok. Default:writeable =write list(S) β the list of users that are allowed read-write access to the share. If a user is in this list, that has precedence overread only = yes. Default:write list =write ok(S) β same effect aswritable. Default:write ok =
β¨ COPYRIGHT β¨
Copyright Β© 2015-2022 ksmbd-tools contributors. License GPLv2: GNU GPL version 2 https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html. π«Ά
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (Like, bestie, fr fr, no take-backs.) π
π REPORTING BUGS π
Found a bug? Not the vibe, but also very valid of you. For bug reports, use the issue tracker at https://github.com/cifsd-team/ksmbd-tools/issues π Please actually report it instead of just suffering in silence, the maintainers wanna know.
π SEE ALSO π
π οΈ Utilities
That's the whole page, bestie β you made it, and honestly? You ate. π
This one's from ksmbd-tools 3.5.7, and the page itself is KSMBD.CONF(5). Go configure something iconic, and remember: smb3 encryption = mandatory means mandatory. Mwah π
β¨
π¦ where this page comes from
- nixpkgs unstable: ksmbd-tools 3.5.7
- ubuntu stonking: ksmbd-tools 3.5.7-1 Β· GPL-2-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms