Difference between revisions of "smb.conf"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (quasi-disambiguation)
 
(→‎Parameters: list complete -- saving for now. Reformat later.)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[smb.conf]] is the main configuration file for the [[Samba]] server, which provides [[Windows (Microsoft)|Windows]] "[[Network Neighborhood]]" [[network share|shares]] on [[Linux]].
+
==Navigation==
==Reference==
+
[[category:system files]][[computing]]: [[software]]: [[Samba]]: [[smb.conf]]
* [[smb.conf (manpage)|manpage]]
+
==Overview==
 +
[[smb.conf]] is the main configuration file for the [[Samba]] server, which provides [[Windows (Microsoft)|Windows]] "[[Network Neighborhood]]" [[network share|shares]] on [[Linux]] (and possibly on other non-Windows [[operating systems]]).
 +
==Articles==
 +
* [[/manpage]]: the official documentation
 +
* [[/examples]]: sample config files
 +
==Parameters==
 +
===[global]===
 +
* {{smb.conf/param|abort shutdown script}}
 +
* {{smb.conf/param|acl compatibility}}
 +
* {{smb.conf/param|add group script}}
 +
* {{smb.conf/param|add machine script}}
 +
* {{smb.conf/param|add port command}}
 +
* {{smb.conf/param|addprinter command}}
 +
* {{smb.conf/param|add share command}}
 +
* {{smb.conf/param|add user script}}
 +
* {{smb.conf/param|add user to group script}}
 +
* {{smb.conf/param|afs username map}}
 +
* {{smb.conf/param|algorithmic rid base}}
 +
* {{smb.conf/param|allow trusted domains}}
 +
* {{smb.conf/param|announce as}}
 +
* {{smb.conf/param|announce version}}
 +
* {{smb.conf/param|auth methods}}
 +
* {{smb.conf/param|bind interfaces only}}
 +
* {{smb.conf/param|browse list}}
 +
* {{smb.conf/param|cache directory}}
 +
* {{smb.conf/param|change share command}}
 +
* {{smb.conf/param|check password script}}
 +
* {{smb.conf/param|client lanman auth}}
 +
* {{smb.conf/param|client ldap sasl wrapping}}
 +
* {{smb.conf/param|client ntlmv2 auth}}
 +
* {{smb.conf/param|client plaintext auth}}
 +
* {{smb.conf/param|client schannel}}
 +
* {{smb.conf/param|client signing}}
 +
* {{smb.conf/param|client use spnego}}
 +
* {{smb.conf/param|cluster addresses}}
 +
* {{smb.conf/param|clustering}}
 +
* {{smb.conf/param|config backend}}
 +
* {{smb.conf/param|config file}}
 +
* {{smb.conf/param|ctdbd socket}}
 +
* {{smb.conf/param|cups connection timeout}}
 +
* {{smb.conf/param|cups server}}
 +
* {{smb.conf/param|deadtime}}
 +
* {{smb.conf/param|debug class}}
 +
* {{smb.conf/param|debug hires timestamp}}
 +
* {{smb.conf/param|debug pid}}
 +
* {{smb.conf/param|debug prefix timestamp}}
 +
* {{smb.conf/param|debug timestamp}}
 +
* {{smb.conf/param|debug uid}}
 +
* {{smb.conf/param|dedicated keytab file}}
 +
* {{smb.conf/param|default service}}
 +
* {{smb.conf/param|defer sharing violations}}
 +
* {{smb.conf/param|delete group script}}
 +
* {{smb.conf/param|deleteprinter command}}
 +
* {{smb.conf/param|delete share command}}
 +
* {{smb.conf/param|delete user from group script}}
 +
* {{smb.conf/param|delete user script}}
 +
* {{smb.conf/param|disable netbios}}
 +
* {{smb.conf/param|disable spoolss}}
 +
* {{smb.conf/param|display charset}}
 +
* {{smb.conf/param|dns proxy}}
 +
* {{smb.conf/param|domain logons}}
 +
* {{smb.conf/param|domain master}}
 +
* {{smb.conf/param|dos charset}}
 +
* {{smb.conf/param|dos filemode}}
 +
* {{smb.conf/param|enable asu support}}
 +
* {{smb.conf/param|enable core files}}
 +
* {{smb.conf/param|enable privileges}}
 +
* {{smb.conf/param|enable spoolss}}
 +
* {{smb.conf/param|encrypt passwords}}
 +
* {{smb.conf/param|enhanced browsing}}
 +
* {{smb.conf/param|enumports command}}
 +
* {{smb.conf/param|eventlog list}}
 +
* {{smb.conf/param|get quota command}}
 +
* {{smb.conf/param|getwd cache}}
 +
* {{smb.conf/param|guest account}}
 +
* {{smb.conf/param|homedir map}}
 +
* {{smb.conf/param|host msdfs}}
 +
* {{smb.conf/param|hostname lookups}}
 +
* {{smb.conf/param|idmap alloc backend}}
 +
* {{smb.conf/param|idmap alloc config}}
 +
* {{smb.conf/param|idmap backend}}
 +
* {{smb.conf/param|idmap cache time}}
 +
* {{smb.conf/param|idmap config}}
 +
* {{smb.conf/param|idmap gid}}
 +
* {{smb.conf/param|idmap negative cache time}}
 +
* {{smb.conf/param|include}} - can actually go anywhere
 +
* {{smb.conf/param|init logon delayed hosts}}
 +
* {{smb.conf/param|init logon delay}}
 +
* {{smb.conf/param|interfaces}}
 +
* {{smb.conf/param|iprint server}}
 +
* {{smb.conf/param|keepalive}}
 +
* {{smb.conf/param|kerberos method}}
 +
* {{smb.conf/param|kernel oplocks}}
 +
* {{smb.conf/param|lanman auth}}
 +
* {{smb.conf/param|large readwrite}}
 +
* {{smb.conf/param|ldap admin dn}}
 +
* {{smb.conf/param|ldap connection timeout}}
 +
* {{smb.conf/param|ldap debug level}}
 +
* {{smb.conf/param|ldap debug threshold}}
 +
* {{smb.conf/param|ldap delete dn}}
 +
* {{smb.conf/param|ldap group suffix}}
 +
* {{smb.conf/param|ldap idmap suffix}}
 +
* {{smb.conf/param|ldap machine suffix}}
 +
* {{smb.conf/param|ldap page size}}
 +
* {{smb.conf/param|ldap passwd sync}}
 +
* {{smb.conf/param|ldap replication sleep}}
 +
* {{smb.conf/param|ldapsam:editposix}}
 +
* {{smb.conf/param|ldapsam:trusted}}
 +
* {{smb.conf/param|ldap ssl ads}}
 +
* {{smb.conf/param|ldap ssl}}
 +
* {{smb.conf/param|ldap suffix}}
 +
* {{smb.conf/param|ldap timeout}}
 +
* {{smb.conf/param|ldap user suffix}}
 +
* {{smb.conf/param|lm announce}}
 +
* {{smb.conf/param|lm interval}}
 +
* {{smb.conf/param|load printers}}
 +
* {{smb.conf/param|local master}}
 +
* {{smb.conf/param|lock directory}}
 +
* {{smb.conf/param|lock spin count}}
 +
* {{smb.conf/param|lock spin time}}
 +
* {{smb.conf/param|log file}}
 +
* {{smb.conf/param|log level}}
 +
* {{smb.conf/param|logon drive}}
 +
* {{smb.conf/param|logon home}}
 +
* {{smb.conf/param|logon path}}
 +
* {{smb.conf/param|logon script}}
 +
* {{smb.conf/param|lpq cache time}}
 +
* {{smb.conf/param|machine password timeout}}
 +
* {{smb.conf/param|mangle prefix}}
 +
* {{smb.conf/param|mangling method}}
 +
* {{smb.conf/param|map to guest}}
 +
* {{smb.conf/param|map untrusted to domain}}
 +
* {{smb.conf/param|max disk size}}
 +
* {{smb.conf/param|max log size}}
 +
* {{smb.conf/param|max mux}}
 +
* {{smb.conf/param|max open files}}
 +
* {{smb.conf/param|max protocol}}
 +
* {{smb.conf/param|max smbd processes}}
 +
* {{smb.conf/param|max stat cache size}}
 +
* {{smb.conf/param|max ttl}}
 +
* {{smb.conf/param|max wins ttl}}
 +
* {{smb.conf/param|max xmit}}
 +
* {{smb.conf/param|message command}}
 +
* {{smb.conf/param|min protocol}}
 +
* {{smb.conf/param|min receivefile size}}
 +
* {{smb.conf/param|min wins ttl}}
 +
* {{smb.conf/param|name cache timeout}}
 +
* {{smb.conf/param|name resolve order}}
 +
* {{smb.conf/param|netbios aliases}}
 +
* {{smb.conf/param|netbios name}}
 +
* {{smb.conf/param|netbios scope}}
 +
* {{smb.conf/param|nis homedir}}
 +
* {{smb.conf/param|ntlm auth}}
 +
* {{smb.conf/param|nt pipe support}}
 +
* {{smb.conf/param|nt status support}}
 +
* {{smb.conf/param|null passwords}}
 +
* {{smb.conf/param|obey pam restrictions}}
 +
* {{smb.conf/param|oplock break wait time}}
 +
* {{smb.conf/param|os2 driver map}}
 +
* {{smb.conf/param|os level}}
 +
* {{smb.conf/param|pam password change}}
 +
* {{smb.conf/param|panic action}}
 +
* {{smb.conf/param|paranoid server security}}
 +
* {{smb.conf/param|passdb backend}}
 +
* {{smb.conf/param|passdb expand explicit}}
 +
* {{smb.conf/param|passwd chat debug}}
 +
* {{smb.conf/param|passwd chat timeout}}
 +
* {{smb.conf/param|passwd chat}}
 +
* {{smb.conf/param|passwd program}}
 +
* {{smb.conf/param|password level}}
 +
* {{smb.conf/param|password server}}
 +
* {{smb.conf/param|perfcount module}}
 +
* {{smb.conf/param|pid directory}}
 +
* {{smb.conf/param|preferred master}}
 +
* {{smb.conf/param|preload modules}}
 +
* {{smb.conf/param|preload}}
 +
* {{smb.conf/param|printcap cache time}}
 +
* {{smb.conf/param|printcap name}}
 +
* {{smb.conf/param|private dir}}
 +
* {{smb.conf/param|read raw}}
 +
* {{smb.conf/param|realm}}
 +
* {{smb.conf/param|registry shares}}
 +
* {{smb.conf/param|remote announce}}
 +
* {{smb.conf/param|remote browse sync}}
 +
* {{smb.conf/param|rename user script}}
 +
* {{smb.conf/param|reset on zero vc}}
 +
* {{smb.conf/param|restrict anonymous}}
 +
* {{smb.conf/param|root directory}}
 +
* {{smb.conf/param|security}}
 +
* {{smb.conf/param|server schannel}}
 +
* {{smb.conf/param|server signing}}
 +
* {{smb.conf/param|server string}}
 +
* {{smb.conf/param|set primary group script}}
 +
* {{smb.conf/param|set quota command}}
 +
* {{smb.conf/param|share:fake_fscaps}}
 +
* {{smb.conf/param|show add printer wizard}}
 +
* {{smb.conf/param|shutdown script}}
 +
* {{smb.conf/param|smb passwd file}}
 +
* {{smb.conf/param|smb ports}}
 +
* {{smb.conf/param|socket address}}
 +
* {{smb.conf/param|socket options}}
 +
* {{smb.conf/param|stat cache}}
 +
* {{smb.conf/param|state directory}}
 +
* {{smb.conf/param|svcctl list}}
 +
* {{smb.conf/param|syslog only}}
 +
* {{smb.conf/param|syslog}}
 +
* {{smb.conf/param|template homedir}}
 +
* {{smb.conf/param|template shell}}
 +
* {{smb.conf/param|time offset}}
 +
* {{smb.conf/param|time server}}
 +
* {{smb.conf/param|unix charset}}
 +
* {{smb.conf/param|unix extensions}}
 +
* {{smb.conf/param|unix password sync}}
 +
* {{smb.conf/param|update encrypted}}
 +
* {{smb.conf/param|use mmap}}
 +
* {{smb.conf/param|username level}}
 +
* {{smb.conf/param|username map script}}
 +
* {{smb.conf/param|username map}}
 +
* {{smb.conf/param|usershare allow guests}}
 +
* {{smb.conf/param|usershare max shares}}
 +
* {{smb.conf/param|usershare owner only}}
 +
* {{smb.conf/param|usershare path}}
 +
* {{smb.conf/param|usershare prefix allow list}}
 +
* {{smb.conf/param|usershare prefix deny list}}
 +
* {{smb.conf/param|usershare template share}}
 +
* {{smb.conf/param|use spnego}}
 +
* {{smb.conf/param|utmp directory}}
 +
* {{smb.conf/param|utmp}}
 +
* {{smb.conf/param|winbind cache time}}
 +
* {{smb.conf/param|winbind enum groups}}
 +
* {{smb.conf/param|winbind enum users}}
 +
* {{smb.conf/param|winbind expand groups}}
 +
* {{smb.conf/param|winbind nested groups}}
 +
* {{smb.conf/param|winbind normalize names}}
 +
* {{smb.conf/param|winbind nss info}}
 +
* {{smb.conf/param|winbind offline logon}}
 +
* {{smb.conf/param|winbind reconnect delay}}
 +
* {{smb.conf/param|winbind refresh tickets}}
 +
* {{smb.conf/param|winbind rpc only}}
 +
* {{smb.conf/param|winbind separator}}
 +
* {{smb.conf/param|winbind trusted domains only}}
 +
* {{smb.conf/param|winbind use default domain}}
 +
* {{smb.conf/param|wins hook}}
 +
* {{smb.conf/param|wins proxy}}
 +
* {{smb.conf/param|wins server}}
 +
* {{smb.conf/param|wins support}}
 +
* {{smb.conf/param|workgroup}}
 +
* {{smb.conf/param|write raw}}
 +
* {{smb.conf/param|wtmp directory}}
 +
===[printers]===
 +
''see [[/printers]]''
 +
===[homes]===
 +
* {{smb.conf/param|access based share enum}}
 +
* {{smb.conf/param|acl check permissions}}
 +
* {{smb.conf/param|acl group control}}
 +
* {{smb.conf/param|acl map full control}}
 +
* {{smb.conf/param|administrative share}}
 +
* {{smb.conf/param|admin users}}
 +
* {{smb.conf/param|afs share}}
 +
* {{smb.conf/param|aio read size}}
 +
* {{smb.conf/param|aio write behind}}
 +
* {{smb.conf/param|aio write size}}
 +
* {{smb.conf/param|allocation roundup size}}
 +
* {{smb.conf/param|available}}
 +
* {{smb.conf/param|blocking locks}}
 +
* {{smb.conf/param|block size}}
 +
* {{smb.conf/param|browseable}}
 +
* {{smb.conf/param|case sensitive}}
 +
* {{smb.conf/param|change notify}}
 +
* {{smb.conf/param|comment}}
 +
* {{smb.conf/param|copy}}
 +
* {{smb.conf/param|create mask}}
 +
* {{smb.conf/param|csc policy}}
 +
* {{smb.conf/param|cups options}}
 +
* {{smb.conf/param|default case}}
 +
* {{smb.conf/param|default devmode}}
 +
* {{smb.conf/param|delete readonly}}
 +
* {{smb.conf/param|delete veto files}}
 +
* {{smb.conf/param|dfree cache time}}
 +
* {{smb.conf/param|dfree command}}
 +
* {{smb.conf/param|directory mask}}
 +
* {{smb.conf/param|directory name cache size}}
 +
* {{smb.conf/param|directory security mask}}
 +
* {{smb.conf/param|dmapi support}}
 +
* {{smb.conf/param|dont descend}}
 +
* {{smb.conf/param|dos filetime resolution}}
 +
* {{smb.conf/param|dos filetimes}}
 +
* {{smb.conf/param|ea support}}
 +
* {{smb.conf/param|fake directory create times}}
 +
* {{smb.conf/param|fake oplocks}}
 +
* {{smb.conf/param|follow symlinks}}
 +
* {{smb.conf/param|force create mode}}
 +
* {{smb.conf/param|force directory mode}}
 +
* {{smb.conf/param|force directory security mode}}
 +
* {{smb.conf/param|force group}}
 +
* {{smb.conf/param|force printername}}
 +
* {{smb.conf/param|force security mode}}
 +
* {{smb.conf/param|force unknown acl user}}
 +
* {{smb.conf/param|force user}}
 +
* {{smb.conf/param|fstype}}
 +
* {{smb.conf/param|guest ok}}
 +
* {{smb.conf/param|guest only}}
 +
* {{smb.conf/param|hide dot files}}
 +
* {{smb.conf/param|hide files}}
 +
* {{smb.conf/param|hide special files}}
 +
* {{smb.conf/param|hide unreadable}}
 +
* {{smb.conf/param|hide unwriteable files}}
 +
* {{smb.conf/param|hosts allow}}
 +
* {{smb.conf/param|hosts deny}}
 +
* {{smb.conf/param|inherit acls}}
 +
* {{smb.conf/param|inherit owner}}
 +
* {{smb.conf/param|inherit permissions}}
 +
* {{smb.conf/param|invalid users}}
 +
* {{smb.conf/param|kernel change notify}}
 +
* {{smb.conf/param|level2 oplocks}}
 +
* {{smb.conf/param|locking}}
 +
* {{smb.conf/param|lppause command}}
 +
* {{smb.conf/param|lpq command}}
 +
* {{smb.conf/param|lpresume command}}
 +
* {{smb.conf/param|lprm command}}
 +
* {{smb.conf/param|magic output}}
 +
* {{smb.conf/param|magic script}}
 +
* {{smb.conf/param|mangled names}}
 +
* {{smb.conf/param|mangling char}}
 +
* {{smb.conf/param|map acl inherit}}
 +
* {{smb.conf/param|map archive}}
 +
* {{smb.conf/param|map hidden}}
 +
* {{smb.conf/param|map read only}}
 +
* {{smb.conf/param|map system}}
 +
* {{smb.conf/param|max connections}}
 +
* {{smb.conf/param|max print jobs}}
 +
* {{smb.conf/param|max reported print jobs}}
 +
* {{smb.conf/param|min print space}}
 +
* {{smb.conf/param|msdfs proxy}}
 +
* {{smb.conf/param|msdfs root}}
 +
* {{smb.conf/param|nt acl support}}
 +
* {{smb.conf/param|only user}}
 +
* {{smb.conf/param|oplock contention limit}}
 +
* {{smb.conf/param|oplocks}}
 +
* {{smb.conf/param|path}}
 +
* {{smb.conf/param|posix locking}}
 +
* {{smb.conf/param|postexec}}
 +
* {{smb.conf/param|preexec close}}
 +
* {{smb.conf/param|preexec}}
 +
* {{smb.conf/param|preserve case}}
 +
* {{smb.conf/param|printable}}
 +
* {{smb.conf/param|print command}}
 +
* {{smb.conf/param|printer admin}}
 +
* {{smb.conf/param|printer name}}
 +
* {{smb.conf/param|printing}}
 +
* {{smb.conf/param|printjob username}}
 +
* {{smb.conf/param|profile acls}}
 +
* {{smb.conf/param|queuepause command}}
 +
* {{smb.conf/param|queueresume command}}
 +
* {{smb.conf/param|read list}}
 +
* {{smb.conf/param|read only}}
 +
* {{smb.conf/param|root postexec}}
 +
* {{smb.conf/param|root preexec close}}
 +
* {{smb.conf/param|root preexec}}
 +
* {{smb.conf/param|security mask}}
 +
* {{smb.conf/param|set directory}}
 +
* {{smb.conf/param|share modes}}
 +
* {{smb.conf/param|short preserve case}}
 +
* {{smb.conf/param|smb encrypt}}
 +
* {{smb.conf/param|store dos attributes}}
 +
* {{smb.conf/param|strict allocate}}
 +
* {{smb.conf/param|strict locking}}
 +
* {{smb.conf/param|strict sync}}
 +
* {{smb.conf/param|sync always}}
 +
* {{smb.conf/param|use client driver}}
 +
* {{smb.conf/param|username}}
 +
* {{smb.conf/param|use sendfile}}
 +
* {{smb.conf/param|valid users}}
 +
* {{smb.conf/param|-valid}}
 +
* {{smb.conf/param|veto files}}
 +
* {{smb.conf/param|veto oplock files}}
 +
* {{smb.conf/param|vfs objects}}
 +
* {{smb.conf/param|volume}}
 +
* {{smb.conf/param|wide links}}
 +
* {{smb.conf/param|writeable}}
 +
* {{smb.conf/param|write cache size}}
 +
* {{smb.conf/param|write list}}
 +
===aliases===
 +
These parameters are aliases for other parameters. Use the real name where possible.
 +
* {{smb.conf/param|allow hosts}} → {{smb.conf/param|hosts allow}}
 +
* {{smb.conf/param|auto services}} → {{smb.conf/param|preload}}
 +
* {{smb.conf/param|browsable}} → {{smb.conf/param|browseable}}
 +
* {{smb.conf/param|casesignames}} → {{smb.conf/param|case sensitive}}
 +
* {{smb.conf/param|create mode}} → {{smb.conf/param|create mask}}
 +
* {{smb.conf/param|debuglevel}} → {{smb.conf/param|log level}}
 +
* {{smb.conf/param|default}} → {{smb.conf/param|default service}}
 +
* {{smb.conf/param|deny hosts}} → {{smb.conf/param|hosts deny}}
 +
* {{smb.conf/param|directory}} → {{smb.conf/param|path}}
 +
* {{smb.conf/param|directory mode}} → {{smb.conf/param|directory mask}}
 +
* {{smb.conf/param|exec}} → {{smb.conf/param|preexec}}
 +
* {{smb.conf/param|group}} → {{smb.conf/param|force group}}
 +
* {{smb.conf/param|lock dir}} → {{smb.conf/param|lock directory}}
 +
* {{smb.conf/param|only guest}} → {{smb.conf/param|guest only}}
 +
* {{smb.conf/param|prefered master}} → {{smb.conf/param|preferred master}}
 +
* {{smb.conf/param|print ok}} → {{smb.conf/param|printable}}
 +
* {{smb.conf/param|printcap}} → {{smb.conf/param|printcap name}}
 +
* {{smb.conf/param|printer}} → {{smb.conf/param|printer name}}
 +
* {{smb.conf/param|protocol}} → {{smb.conf/param|max protocol}}
 +
* {{smb.conf/param|public}} → {{smb.conf/param|guest ok}}
 +
* {{smb.conf/param|root}} → {{smb.conf/param|root directory}}
 +
* {{smb.conf/param|root dir}} → {{smb.conf/param|root directory}}
 +
* {{smb.conf/param|timestamp logs}} → {{smb.conf/param|debug timestamp}}
 +
* {{smb.conf/param|user}} → {{smb.conf/param|username}}
 +
* {{smb.conf/param|users}} → {{smb.conf/param|username}}
 +
* {{smb.conf/param|vfs object}} → {{smb.conf/param|vfs objects}}
 +
* {{smb.conf/param|winbind gid}} → {{smb.conf/param|idmap gid}}
 +
* {{smb.conf/param|winbind uid}} → {{smb.conf/param|idmap uid}}
 +
* {{smb.conf/param|writable}} → {{smb.conf/param|writeable}}
 +
* {{smb.conf/param|writeable}} → ''not'' {{smb.conf/param|read only}}
 +
===usershares===
 +
Starting with Samba version 3.0.23 the capability for non−root users to add, modify, and delete their own share definitions has been added. This capability is called usershares and is controlled by a set of parameters in the [global] section of the smb.conf. The relevant parameters are :
 +
* {{smb.conf/param|usershare allow guests}} - Controls if usershares can permit guest access.
 +
* {{smb.conf/param|usershare max shares}} - Maximum number of user defined shares allowed.
 +
* {{smb.conf/param|usershare owner only}} - If set only directories owned by the sharing user can be shared.
 +
* {{smb.conf/param|usershare path}} - Points to the directory containing the user defined share definitions. The filesystem permissions on this directory control who can create user defined shares.
 +
* {{smb.conf/param|usershare prefix allow list}} - Comma−separated list of absolute pathnames: only directories below the pathnames in this list are permitted.
 +
* {{smb.conf/param|usershare prefix deny list}} - Comma−separated list of absolute pathnames: directories below the pathnames in this list are prohibited.
 +
* {{smb.conf/param|usershare template share}} - Names a pre-existing share used as a template for creating new usershares. All other share parameters not specified in the user defined share definition are copied from this named share.
 +
 
 +
==variable substitutions==
 +
Many of the strings that are settable in the config file can take substitutions. For example the option "path = /tmp/%u" is interpreted as "path = /tmp/john" if the user connected with the username john.
 +
 
 +
These substitutions are mostly noted in the descriptions below, but there are some general substitutions which apply whenever they might be relevant. These are:
 +
 
 +
* '''%U''' - session username (the username that the client wanted, not necessarily the same as the one they got).
 +
* '''%G''' - primary group name of %U.
 +
* '''%h''' - the Internet hostname that Samba is running on.
 +
* '''%m''' - the [[NetBIOS name]] of the client machine (very useful).
 +
*: This parameter is not available when Samba listens on port 445, as clients no longer send this information. If you use this macro in an include statement on a domain that has a Samba domain controller be sure to set in the [global] section smb ports = 139. This will cause Samba to not listen on port 445 and will permit include functionality to function as it did with Samba 2.x.
 +
* '''%L''' - the [[NetBIOS name]] of the server. This allows you to change your config based on what the client calls you. Your server can have a "dual personality".
 +
* '''%M''' - the Internet name of the client machine.
 +
* '''%R''' - the selected protocol level after protocol negotiation. It can be one of CORE, COREPLUS, LANMAN1, LANMAN2 or NT1.
 +
* '''%d''' - the process id of the current server process.
 +
* '''%a''' - The architecture of the remote machine. It currently recognizes [[Samba]] ('''Samba'''), the [[Linux CIFS]] file system ('''CIFSFS'''), [[OS/2]], ('''OS2'''), [[Windows for Workgroups]] ('''WfWg'''), [[Windows 9x/ME]] ('''Win95'''), [[Windows NT]] ('''WinNT'''), [[Windows 2000]] ('''Win2K'''), [[Windows XP]] ('''WinXP'''), [[Windows XP 64-bit]] ('''WinXP64'''), [[Windows 2003]] including 2003R2 ('''Win2K3'''), and [[Windows Vista]] ('''Vista'''). Anything else will be known as '''UNKNOWN'''.
 +
 
 +
* '''%I''' - the [[IP address]] of the client machine.
 +
* '''%i''' - the [[local IP address]] to which a client connected.
 +
* '''%T''' - the current date and time.
 +
* '''%D''' - name of the [[Windows domain|domain]] or [[Windows workgroup|workgroup]] of the current user.
 +
* '''%w''' - the winbind separator.
 +
* '''%$('''envvar''')''' - the value of the environment variable envar.
 +
 
 +
The following substitutes apply only to some configuration options (only those that are used when a connection has been established):
 +
 
 +
* '''%S''' - the name of the current service, if any.
 +
* '''%P''' - the root directory of the current service, if any.
 +
* '''%u''' - username of the current service, if any.
 +
* '''%g''' - primary group name of '''%u'''.
 +
* '''%H''' - the home directory of the user given by '''%u'''.
 +
* '''%N''' - the name of your [[NIS]] home directory server. This is obtained from your NIS auto.map entry. If you have not compiled Samba with the --with-automount option, this value will be the same as '''%L'''.
 +
* '''%p''' - the path of the service´s home directory, obtained from your NIS auto.map entry. The NIS auto.map entry is split up as '''%N:%p'''.
 +
 
 +
There are some quite creative things that can be done with these substitutions and other smb.conf options.

Latest revision as of 21:42, 10 September 2010

Navigation

computing: software: Samba: smb.conf

Overview

smb.conf is the main configuration file for the Samba server, which provides Windows "Network Neighborhood" shares on Linux (and possibly on other non-Windows operating systems).

Articles

Parameters

[global]

[printers]

see /printers

[homes]

aliases

These parameters are aliases for other parameters. Use the real name where possible.

usershares

Starting with Samba version 3.0.23 the capability for non−root users to add, modify, and delete their own share definitions has been added. This capability is called usershares and is controlled by a set of parameters in the [global] section of the smb.conf. The relevant parameters are :

  • usershare allow guests - Controls if usershares can permit guest access.
  • usershare max shares - Maximum number of user defined shares allowed.
  • usershare owner only - If set only directories owned by the sharing user can be shared.
  • usershare path - Points to the directory containing the user defined share definitions. The filesystem permissions on this directory control who can create user defined shares.
  • usershare prefix allow list - Comma−separated list of absolute pathnames: only directories below the pathnames in this list are permitted.
  • usershare prefix deny list - Comma−separated list of absolute pathnames: directories below the pathnames in this list are prohibited.
  • usershare template share - Names a pre-existing share used as a template for creating new usershares. All other share parameters not specified in the user defined share definition are copied from this named share.

variable substitutions

Many of the strings that are settable in the config file can take substitutions. For example the option "path = /tmp/%u" is interpreted as "path = /tmp/john" if the user connected with the username john.

These substitutions are mostly noted in the descriptions below, but there are some general substitutions which apply whenever they might be relevant. These are:

  • %U - session username (the username that the client wanted, not necessarily the same as the one they got).
  • %G - primary group name of %U.
  • %h - the Internet hostname that Samba is running on.
  • %m - the NetBIOS name of the client machine (very useful).
    This parameter is not available when Samba listens on port 445, as clients no longer send this information. If you use this macro in an include statement on a domain that has a Samba domain controller be sure to set in the [global] section smb ports = 139. This will cause Samba to not listen on port 445 and will permit include functionality to function as it did with Samba 2.x.
  • %L - the NetBIOS name of the server. This allows you to change your config based on what the client calls you. Your server can have a "dual personality".
  • %M - the Internet name of the client machine.
  • %R - the selected protocol level after protocol negotiation. It can be one of CORE, COREPLUS, LANMAN1, LANMAN2 or NT1.
  • %d - the process id of the current server process.
  • %a - The architecture of the remote machine. It currently recognizes Samba (Samba), the Linux CIFS file system (CIFSFS), OS/2, (OS2), Windows for Workgroups (WfWg), Windows 9x/ME (Win95), Windows NT (WinNT), Windows 2000 (Win2K), Windows XP (WinXP), Windows XP 64-bit (WinXP64), Windows 2003 including 2003R2 (Win2K3), and Windows Vista (Vista). Anything else will be known as UNKNOWN.
  • %I - the IP address of the client machine.
  • %i - the local IP address to which a client connected.
  • %T - the current date and time.
  • %D - name of the domain or workgroup of the current user.
  • %w - the winbind separator.
  • %$(envvar) - the value of the environment variable envar.

The following substitutes apply only to some configuration options (only those that are used when a connection has been established):

  • %S - the name of the current service, if any.
  • %P - the root directory of the current service, if any.
  • %u - username of the current service, if any.
  • %g - primary group name of %u.
  • %H - the home directory of the user given by %u.
  • %N - the name of your NIS home directory server. This is obtained from your NIS auto.map entry. If you have not compiled Samba with the --with-automount option, this value will be the same as %L.
  • %p - the path of the service´s home directory, obtained from your NIS auto.map entry. The NIS auto.map entry is split up as %N:%p.

There are some quite creative things that can be done with these substitutions and other smb.conf options.