Samba shares are read-only from both Windows and Linux
I have been pointed to a solution (not the solution). If I add sambauser
to the group of myusersrv
on sambaserv
, the problem goes away. However, this is not a good solution, because it requires messing with user groups, which I might not have been able to do in a different environment.
Related videos on Youtube
Pastafarianist
Updated on September 18, 2022Comments
-
Pastafarianist almost 2 years
I'm trying to configure Samba running on Gentoo Linux to share my external NTFS drive with two other machines, one running Gentoo as well and the other running Windows 7. Previously this drive was connected to a Samba-enabled router (Zyxel Keenetic Giga II) and I could connect to it using the login/pass pair specified in the web interface. I had both read and write access.
Now I'm trying to configure Samba to allow anyone who specifies the valid login/pass pair to have full access. The login/pass are unique (I do not use that username anywhere else).
I managed to connect both Linux and Windows machines, but only in read-only mode. I get
Permission denied
on all attempts to write, even though the permissions fromls
show that I should be able to write.The network structure is:
sambaserv:
Samba server hostnamesambauser/sambapass:
Samba login credentialsmyuserserv:
my user login
linuxclient:
Linux client hostnamemyuserclient:
my user login
winclient:
Win 7 client hostname
Here's what I have done:
sambaserv: ls -l /mnt
... drwxrwxr-x 1 myuserserv myuserserv 4096 2 June 01:08 storage
sambaserv: /etc/fstab
/dev/sdc1 /mnt/storage ntfs-3g defaults,uid=1000,gid=1000,umask=0002,noatime 0 0
Here
1000
is the ID ofmyuserserv
. I'd like to use this drive for purposes other than Samba sharing, so I didn't specifysambauser
instead.
sambaserv:
Createdsambauser
by issuing these commands:useradd sambauser passwd sambauser pdbedit -a -u sambauser
sambaserv: testparm
$ sudo testparm Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[storage]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions [global] server string = sambaserv log file = /var/log/samba/log.%m max log size = 50 dns proxy = No idmap config * : backend = tdb hosts allow = 192.168.1., 127. [storage] comment = Storage path = /mnt/storage valid users = sambauser read only = No create mask = 0775 directory mask = 0775
I have no idea how file permissions are handled considering that the drive is NTFS, but these would be okay if it wasn't.
linuxclient: ls -l /mnt
... drwxrwxr-x 1 myuserclient myuserclient 0 2 juin 01:08 storage
linuxclient: /etc/fstab
//sambaserv/storage /mnt/storage cifs credentials=/home/myuserclient/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
winclient:
Typed thesambauser/sambapass
pair inConnect network drive
underMy Computer
.
How do I get write access under Linux and Windows?
-
Admin about 9 yearsDoesn't work for me. However, what does work (as I have just discovered) is adding
sambauser
to the group ofmyuserserv
(and restarting Samba daemon).