0

I’m unable to edit files on a Samba share.

I’ve got two machines, srv001 and desk001, both with Arch Linux. I want to connect to srv001 from desk001 using samba and sshfs (different scenarios), but I installed them a little differently, resulting in the users having different UIDs/GIDs (see below).

srv001 - Users:

  • UserA [1000], primary group ‘mediaPublic [1002]’
  • ServerA [1001], primary group ‘mediaPublic [1002]’

desk001 – Users:

  • UserA [1001], primary group ‘mediaPublic [1001]’
  • ServerA [1000], primary group ‘mediaPublic [1001]’

Most of the served files on my server belong to ServerA:mediaPublic, both users UserA and ServerA belong to group mediaPublic. They have a Samba entry:

[media_public] 
comment = Media Server Centre - Media Files 
read only = no 
locking = yes 
path = /mnt/local/media/public
guest ok = no 
write list = UserA, ServerA

force create mode = 2770 
force directory mode = 2770 
force user = msc 
force group = mediaPublic

...and an /etc/fstab entry:

//srv001/media_public /mnt/remote/srv001/public cifs vers=2.1,uid=1000,gid=1001,username=UserA,password=APassword 0 0

Before Mounting:

[root@desk001 srv001]# ls -l
total 4K
drwxrwxr-x 2 ServerA media_public 4K May 24 19:35 public

After Mounting

[root@desk001 srv001]$ ls -l
total 0
drwxr-xr-x 2 ServerA media_public 0K May 27 17:30 public

After Mounting - Public Subfolder

[root@desk001 srv001]# ls /mnt/remote/srv001/public/ -l --block-size=M
total 527M 
-rwxr-xr-x 1 ServerA media_public 523M Oct  6  2017  
archlinux-2017.10.01-x86_64.iso
drwxr-xr-x 2 ServerA mediaPublic         1M Jan 19  2017  Images
drwxr-xr-x 2 ServerA mediaPublic         1M May 25 09:41  Torrents
drwxr-xr-x 2 ServerA mediaPublic         1M May 24 22:19  TVShows
drwxr-xr-x 2 ServerA mediaPublic         1M Dec 20 12:12  Wallpapers

srv001

root@msc001x: /mnt/local/int001/MEDIA$ ls -l --block-size=K
total 104032K
drwxrws---+ 1 ServerA mediaPublic      1K Dec 16 22:07 Personal
-rwxrws---  1 ServerA mediaPublic 104032K May 30  2017 plexmediaserver_1.7.2.3878-8088811b8_amd64.deb
drwxrwsr-x+ 1 ServerA mediaPublic      1K May 27 17:30 Public

srv001 - public sub folder

root@srv001:/mnt/local/int001/MEDIA/Public$ ls -l --block-size=M
total 527M
-rwxrwxr-x  1 ServerA mediaPublic 523M Oct  6  2017 archlinux-2017.10.01-x86_64.iso
drwxrwsr-x+ 1 ServerA mediaPublic       1M Jan 19  2017 Images
drwxrwsr-x+ 1 ServerA mediaPublic       1M May 25 09:41 Torrents
drwxrwsr-x+ 1 ServerA mediaPublic        1M May 24 22:19 TVShows
drwxrwsr-x+ 1 ServerA mediaPublic        1M Dec 20 12:12 Wallpapers

What is my problem. Firstly how, with the above Samba scenario, can I map the users so I can access the files as the correct user. Secondly, why is it mounting as 755 when it was originally 775 before mount.,

  • Unlike NFS, the uid and gid don't need to be the same with smb. Did you set an smb password for UserA and ServerA on srv001? Are you using those to connect to the share? – Nasir Riley May 27 '18 at 14:34
  • @NasirRiley I am, I just changed it to a credential file and it acts the same way. Starts as 775 before mounting (mount point and remote directory), becomes 755 after mounting. – aSystemOverload May 27 '18 at 15:02
  • Edit your question to include the output of ls -l on the share before and after it's mounted. – Nasir Riley May 27 '18 at 15:09
  • I've added the ls -l as requested./ – aSystemOverload May 27 '18 at 15:45
  • 1
    I'm still rather confused here. Your fstab says that the mountpoint on desk001 is /mnt/remote/srv001/public but then you run ls -l on /mnt/remote/msc001x/public/ which is a different directory. The directories on Srv001 show that the directories have sizes greater than zero and there is also a file called archlinux-2017.10.01-x86_64.iso whereas the directories on desk001 have sizes of 0 and archlinux-2017.10.01-x86_64.iso is nowhere to be found. Also, what is /mnt/local/int001/MEDIA/Public$ under Srv001 - same folder? I thought that the share was media_public? – Nasir Riley May 30 '18 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.