2

I have a quick question in regards to Samba share. I have recently built an Ubuntu server and moved all my previous Windows NTFS HDD into the server. My goal is to share all 4 HDD to utilize on my other Windows machines and to share through Plex media server. I have shared the HDD through Ubuntu but I can't change permissions and even when trying to manually configure through smb.conf I can't get the permissions to successfully change. I have attached what I have configured in the smb.conf. Any help would be greatly appreciated. Here is the rest of the smb.conf for reference.

[global]

   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)
   wins support = yes
   dns proxy = no



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

   syslog = 0
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######


  security = user
  encrypt passwords = true
  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

  map to guest = bad user


#======================= Share Definitions =======================

  realm = localdomain
  server role = domain controller
  server services = +smb -s3fs
  dcerpc endpoint servers = -winreg -srvsvc
[printers]
  comment = All Printers
  browseable = no
  path = /var/spool/samba
  printable = yes
  guest ok = no
  read only = yes
  create mask = 0700


[print$]
  comment = Printer Drivers
  path = /var/lib/samba/printers
  browseable = yes
  read only = yes
  guest ok = no


# Ross's Shares
[share]
    comment = home
    path = /home/roce/Downloads
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777

[share]
    comment = SDB - Data
    path = /home/roce/Data
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777

[share]
    comment = SDC - Movies
    path = /home/roce/Movies
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777

[share]
    comment = SDD - TV Shows
    path = /home/roce/TV Shows
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777

[share]
    comment = SDE
    path = /home/roce/Data
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0777

[sysvol]
  path = /var/lib/samba/sysvol
  read only = no

[netlogon]
  path = /var/lib/samba/sysvol/localdomain/scripts
  read only = no
Roce
  • 21
  • 1
  • 3
  • I don't know if this will solve your problems, but it looks like you have given most of your shares the same name "share"

    I also find after adding/changing SAMBA shares I have to restart the smbd service and the nmbd service before they will show up and work properly. Of course, a reboot will also restart smbd and nmbd, but that's the painful slow way.

    – SunnyDaze May 30 '18 at 20:35

1 Answers1

0

Your file system permissions need to allow access as well (system > samba). For NTFS, the permissions are determined by the way you mount it. Try:

sudo umount /desired/path
sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000,exec /dev/desired/path /mnt/desired/path

From the mount man page: "By default, the files are owned by root and not readable by somebody else." You could also try ntfs3g: http://manpages.ubuntu.com/manpages/oneiric/man8/ntfs-3g.8.html#contenttoc, but the best option might be to modify your fstab using the permissions option:

sudo umount /desired/path
sudo blkid
sudo gedit /etc/fstab

The blkid command is to find the partition UUID. Edit the entry in fstab like this:

    # change the "UUID" to your partition UUID
    UUID=12102C02102CEB83 /media/windows ntfs-3g auto,users,permissions 0 0

Lastly, make a mount point and mount the external hard drive:

sudo mkdir /media/windows
mount /media/windows

The "auto" option will automatically mount the partition when you boot, and the "users" option will allow users to mount and umount. If it were not an NTFS drive, you could try this from terminal:

sudo chmod -R 775 /desired/path

Credits: How do I use 'chmod' on an NTFS (or FAT32) partition?

musicman1979
  • 1,147
  • 1
  • 9
  • 26