2
Once again samba has completely confused me. I need a share which is accessible (r/w) to only authenticated users. Everyone needs to be able to modify others' files, so I'd prefer to use groups for permissions. When I try to connect from my windows machine or my macbook, it tells me that my account does not have permission to access the share.
The share directory's group is set to users. The user is in group users.
Whenever I type "groups" or "users" neither the added client user nor the group shows up. I also cannot log in using the account "jonah" which I added to test the samba connectivity.
I have no clue what the problem is and I need to get this done, so here's my smb.conf.
#Global
[global]
workgroup = WORKGROUP
netbios name = sambasrv
server string = Samba Server
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
preferred master = No
local master = No
dns proxy = No
security = User
#Share
[share0]
path = /mnt/storage/share0
valid users = jonah
read only = No
create mask = 2744
directory mask = 2744
browsable = Yes
1
create mask = 2744
: you should not use setgid on files (2---), you should not set them executable by default (-7--), and you want to allow write for group (--4-). The correct would be0664
. Fordirectory mask
, you want it browseable and writeable by group at least, and browseable by all maybe. It should be2775
. You should learn a bit about Unix permissions. – piernov – 2014-07-24T12:56:27.497But that's not the only problem, I've just seen you edited. How did you add your user ? – piernov – 2014-07-24T12:58:14.077
useradd -c "Jonah" jonah. I then used smbpasswd to make the password for it with samba. So should I add an Unix password for the account as well? – Jonah – 2014-07-24T12:59:16.563
I've run the command
smbpasswd -e jonah
and though it said the user is now enabled, after a restart I got the same problem. – Jonah – 2014-07-24T13:17:21.8231
users
shows the current logged in users,groups
shows the groups the current user is in. To check your user was added successfully as a unix user, usegetent passwd jonah
. In order to log in to the Linux system with that user, it either need to have a password or to be unlocked (sudo passwd -f -u jonah
). However it should already work in Samba (if you're sure the permissions are correct, especially the current permission of /mnt/storage/share0, dols -l /mnt/storage/share0
to check). – piernov – 2014-07-24T13:26:27.073ls -l /mnt...
returnstotal 0
Does this mean the permissions aren't correctly assigned? – Jonah – 2014-07-24T13:32:54.747Sorry, I forgot a parameter, it is:
ls -ld /mnt/storage/share0
– piernov – 2014-07-24T13:43:55.967It returns
drwxrwxr-x 2 administrator users 4096 Jul 24 14:41 /mnt/storage/share0
- Do i need to change the owner, bearing in mind more than one person will connect when this is finished? – Jonah – 2014-07-24T13:52:01.4601It should be correct and you normally don't need to change the owner. But you need to add
@users
tovalid users
insmb.conf
since it will allow all users from the users group to access the share. – piernov – 2014-07-24T14:01:19.180