13.03.2014

samba

/etc/samba/smb.conf

[global]
 workgroup = 7EVEN.NET
 netbios name = cubie
 server string = %h server

;    interfaces = lo, 10.10.10.0/24 eth0
 interfaces = lo, eth0
 bind interfaces only = true

 dos charset = cp688
 unix charset = UTF8

 syslog = 0
 log file = /var/log/samba/log.%m
 max log size = 1000

 dns proxy = No
 panic action = /usr/share/samba/panic-action %d

 security = share
# отключаем принтеры 
 load printers = no 
 show add printer wizard = no 
 printcap name = /dev/null 
 disable spoolss = yes 

# по умолчанию все файлы, начинающиеся с точки будут иметь атрибут "скрытый" 
 hide dot files = yes


[share]
 path = /home/user/sata
 comment = Share
 create mode = 0777
 directory mask = 0777
 available = yes
 browsable = yes
 public = yes
 writable = yes
 printable = no
adduser user
sudo smbpasswd -a user
mkdir -p /home/user/sata
chown -R root:users /home/user/sata
chmod -R 0777 /home/user/sata
/etc/init.d/samba restart

Директива security = share устарела, то конфиг для версии старше 4 меняется следующим образом:
[global]
  workgroup = DEAD.NET
  netbios name = cubieboard2
  server string = Samba Server %v

  dns proxy = no
  log file = /var/log/samba/log.%m
  max log size = 1000
  syslog = 0
  panic action = /usr/share/samba/panic-action %d

  server role = standalone server
  security = user
 # Если пользователь Samba существует в системе и введен неверный пароль, 
 # то вход этого пользователя отклоняется, 
 # если пользователя не существует, 
 # тогда ему присваивается статус гость
  map to guest = Bad Password
  passdb backend = tdbsam
  obey pam restrictions = yes
  unix password sync = yes
  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
  usershare allow guests = yes
 # по умолчанию все файлы, начинающиеся с точки будут иметь атрибут "скрытый" 
  hide dot files = yes

 # отключаем принтеры 
  #load printers = no 
  #show add printer wizard = no 
  #printcap name = /dev/null 
  #disable spoolss = yes 

  #  SHARE
    [share]
     comment = Share
     path = /mnt/sata
     public = yes
     writable = yes
     available = yes
     browsable = yes
     guest ok = yes
     create mask = 0777
     directory mask = 0777

Комментариев нет: