User Tools

Site Tools


samba

Настройка общих папок в Samba

Preps:

Set the base permissions on the share:

chmod -R root.share /srv/share
chmod -R u+rwX,g+rwX,o-rwx /srv/share

For read-only guest access, change 'o-rwx' ⇒ 'o=rX'. Then enable setgid propogation on directories to ensure correct ownership:

find /srv/share -type d -print0 | xargs -0 chmod g+s

Create the share definition:

[share]
  comment = Main File Share
  path = /srv/share
  browseable = yes
  read only = no
  guest ok = yes
  create mask = 0660
  directory mask = 2770

For read-only guest access, change the masks to:

create mask = 0664
directory mask = 2775

———————–

Пример

[share]
  # доступ на запись всем (анонимно)
  comment = public share
  path = /mnt/sata/share
  browsable = yes
  writable = yes
  read only = no
  guest ok = yes
  guest only = yes
  create mode = 0777
  directory mode = 0777

[backup]
  # доступ на запись по паролю пользователю 'nas'
  comment = backup folder
  path = /mnt/sata/backup
  browsable = no
  writable = yes
  read only = no
  public = no
  guest ok = no
  create mode = 0777
  directory mode = 0777
  valid users = nas

[media]
  # доступ на запись по паролю пользователю 'nas' (# chmod), остальным только чтение
  comment = media
  path = /mnt/sata/media
  browsable = yes
  read only = no
  guest ok = yes
  guest only = yes
  create mask = 0664
  directory mask = 2775

Odroid tip page

samba.txt · Last modified: 2018/08/19 12:19 by admin