Samba Server   «Prev 

Samba Configuration File

Samba Configuration File

  1. Every share's configuration begins with a string enclosed in square brackets. In this case, the global share's configuration follows [global]
  2. These are the global configuration options, specified using name = value syntax. Samba will set the given name's value to whatever follows the equal sign. Comment lines begin with a semi-colon(;) or a hash (#)
  3. Every share's configuration begins with a string enclosed in square brackets. In this case the home share's configuration follows [homes].
  4. These are the home share's configuration options, specified using name=value syntax. Samba will set the given name's value to whatever follows the equal sign. Comment lines begin with a semi-colon(;)

Configuring Samba Server

The configuration file smb.conf
  1. Global section
  2. Share sections

Global

Example: [global]
workgroup = MYGROUP
server string = Samba Server
printcap name = /etc/printcap
load printers = yes
printing = lprng
log file= /var/log/samba/%m.log
max log size=0
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd

Homes section

The Homes section is a special share section
Use the home dir from /etc/passwd based on user name requesting the share.
Example: [homes]
comment = Home directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775

Sharing directories

Example: [research]
comment = Research Department Shared Dir
path = /home/research
browsable = no
writable = yes
create mode = 0750
hosts allow = horseshow,crab

Sharing printers

Example: [printers]
comment = all printers
path = /var/spool/samba
browsable = no
guest ok = no
writable = no
printable = yes