Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer

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 to 'chmod' on an NTFS ( or FAT32 ) partition?

share|improve this answer
    
but I was under the impression you can't use chmod for NTFS, no? –  Roce Jan 12 at 14:28
    
You are correct, and I've corrected my answer. I didn't notice you were using ntfs for the hard drives. –  conman253 Jan 13 at 22:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.