Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Read only samba share after upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 638
Location: UK

PostPosted: Thu Apr 07, 2016 3:27 pm    Post subject: Read only samba share after upgrade Reply with quote

I use samba on a gentoo server to share some directories to a couple of Ubuntu clients. Since the upgrade to samba-4.2.9 I'm having trouble connecting with write permissions.

I can mount the folders as an anonymous user, but not via the command line

In the Ubuntu fstab I have:

Code:
//192.168.0.5/public   /mnt/con1    cifs    auto,username=guest


Issuing the command: 'mount /mnt/con1' I get this error:

Code:
mount: //192/168.0.5/public is write-protected, mounting read-only
mount: cannot mount //192.168.0.5/public read-only


/etc/smb.conf on the server:

Code:

[global]

   workgroup = SURGERY

   server string = Samba

hosts allow = 192.168.0.0/255.255.255.0

log file = /var/log/smb/samba.%m
   max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = cups
disable spoolss = Yes
show add printer wizard = No
printing = cups

dos charset = 850
unix charset = UTF-8

[public]
        comment = shared
        path = /mnt/Shared/Data
        guest ok = yes
        browseable = yes
        writeable = yes
        force user = Staff
        force group = users
        wide links = yes

[printers]
        comment = All Printers
        path = /var/spool/samba
        printer admin = root, local_user
        create mask = 0600
        guest ok = Yes
        printable = Yes
        use client driver = Yes
        browseable = No

[DICOM]
        comment = shared
        path = /mnt/vault/DICOM
        guest ok = yes
        browseable = yes
        writable = yes
        force user = Staff
        force group = users
        wide links = yes


Before the upgrade, I mounted this in fstab with this command:

Code:
//192.168.0.5/public   /mnt/con1   cifs    auto,username=Staff,password=123


Unfortunately that no longer works either, hence trying to get it to work as a guest.
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 622
Location: Yeovil, Somerset, UK

PostPosted: Sat Apr 09, 2016 10:50 pm    Post subject: Re: Read only samba share after upgrade Reply with quote

There is almost certainly another change apart from the version upgrade. Anyway, assuming you want to go back to using your Staff user:

Ensure the Staff password is set correctly (pdbedit or whatever)

Fix up permissions on the share
#chown -Rvf Staff:users /mnt/Shared/Data
#chmod -Rvf u=rwx,g=rxs,o= /mnt/Shared/Data

You could instead use "find -type d -exec chmod ..." to do the g=rxs bit instead so that only directories get the s bit. It will ensure that future files get the "users" group.

In smb.conf:
[public]
comment = shared
path = /mnt/Shared/Data
guest ok = NO
browseable = yes
writeable = yes
force user = Staff
force group = users
wide links = yes

Samba works just like Windows albeit with a lot more flexibility. The share defines in smb.conf are near enough equivalent to the shares in Windows but you must also get the file system permissions correct as well.

guest ok = yes is rarely what you want, especially for user data.

Cheers
Jon
Back to top
View user's profile Send private message
tabanus
l33t
l33t


Joined: 11 Jun 2004
Posts: 638
Location: UK

PostPosted: Tue Apr 12, 2016 10:12 pm    Post subject: Reply with quote

Thanks for the suggestions, but it didn't work.

For now I've rolled back to samba-3.6.25, and everything's working OK again.
_________________
Things you might say if you never took Physics: "I'm overweight even though I don't overeat." - Neil deGrasse Tyson
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum