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 from ls
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 of myuserserv
. I'd like to use this drive for purposes other than Samba sharing, so I didn't specify sambauser
instead.
sambaserv:
Created sambauser
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 the sambauser/sambapass
pair in Connect network drive
under My Computer
.
How do I get write access under Linux and Windows?