Ubuntu server 12.04/samba

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m (Configuring a Samba server)
m
 
Line 30: Line 30:
 
   map system = no
 
   map system = no
 
   map hidden = no
 
   map hidden = no
   password level = 0
+
 
 +
   passwd program = /usr/bin/passwd %u
 +
  passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
 +
  pam password change = yes
 +
  encrypt passwords = true
 +
  passdb backend = tdbsam
 +
  obey pam restrictions = yes
 +
  unix password sync = yes
  
 
# ----------------------- Netwrok Related Options -------------------------
 
# ----------------------- Netwrok Related Options -------------------------
   workgroup = local
+
   workgroup = attie.co.uk
   server string = MyServer
+
   server string = akela
 +
  dns proxy = no
  
 
# --------------------------- Logging Options -----------------------------
 
# --------------------------- Logging Options -----------------------------
Line 41: Line 49:
 
   # max 50KB per log file, then rotate
 
   # max 50KB per log file, then rotate
 
   max log size = 50
 
   max log size = 50
 +
  log level = 1
 +
  debug level = 1
  
# ----------------------- Standalone Server Options ------------------------
+
# ------------------------- User handling Options --------------------------
  security = share
+
 
   guest account = nobody
 
   guest account = nobody
 
   map to guest = bad user
 
   map to guest = bad user
Line 49: Line 58:
 
# --------------------------- Printing Options -----------------------------
 
# --------------------------- Printing Options -----------------------------
 
   cups options = raw
 
   cups options = raw
 
  
 
#============================ Share Definitions ==============================
 
#============================ Share Definitions ==============================

Latest revision as of 17:01, 3 August 2012

Ubuntu Server 12.04

apt-get install samba

[edit] Configuring a Samba server

Below is a simple configuration file.

  • It will provide anonymouse access for everyone to the /home/shared directory.
  • It will also provide authenticated access for users to their home directory.
  • Don't forget to use sudo smbpasswd -a <username> to give the users a samba account!
  • Test the config with testparm
  • Add the following line to /etc/security/limits.conf: * - nofile 16384
  • You will need to do this as well:
mkdir /home/shared
chown nobody:nogroup /home/shared
chmod 775 /home/shared

Contents of /etc/samba/smb.conf

#======================= Global Settings =====================================
 
[global]
  follow symlinks = yes
  wide links = yes
  unix extensions = no
  hide dot files = yes
  map archive = no
  map system = no
  map hidden = no
 
  passwd program = /usr/bin/passwd %u
  passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
  pam password change = yes
  encrypt passwords = true
  passdb backend = tdbsam
  obey pam restrictions = yes
  unix password sync = yes
 
# ----------------------- Netwrok Related Options -------------------------
  workgroup = attie.co.uk
  server string = akela
  dns proxy = no
 
# --------------------------- Logging Options -----------------------------
  # logs split per machine
  log file = /var/log/samba/log.%m
  # max 50KB per log file, then rotate
  max log size = 50
  log level = 1
  debug level = 1
 
# ------------------------- User handling Options --------------------------
  guest account = nobody
  map to guest = bad user
 
# --------------------------- Printing Options -----------------------------
  cups options = raw
 
#============================ Share Definitions ==============================
 
[homes]
  comment = Home Directories
  browseable = no
  writable = yes
  directory mask = 0777
  force directory mode = 0777
  create mask = 0666
  force create mode = 0666
 
[shared]
  comment = Shared
  browsable = yes
  path = /home/shared
  public = yes
  writable = yes
  guest ok = yes
  force group = nogroup
  force user = nobody
  directory mask = 0777
  force directory mode = 0777
  create mask = 0666
  force create mode = 0666
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox