PDA

View Full Version : Samba - sharing with user rights


gromot
21-06-2008, 17:06
Hi,
I have WL-500gP with Oleg 1.9.2.7-10 firmware installed. Also have installed Samba2 and mounted HDD.
What I want to achieve is to give different permissions for users to different folders, e.g.
- Folder1 - RW for User1, ReadOnly for User2
- Folder2 - ReadOnly for User1, RW for User 2

Can anybody help me with it?:)
I know Samba works, I have access to folders with "gest ok = yes" set in smb.conf. but can not log in to folders with set:
valid users = luk
write list = luk

logfile says:
[2008/06/20 20:32:09, 0] source/smbd/password.c:authorise_login(863)
authorise_login: rejected invalid user nobody

I think this can be a key info for somebody who know/understand Samba. This appears in the log file when I double click on the shared folder, before I enter any username / password in the windows prompt. It looks like Samba automatically trys to use the "nobody" user for everything. Am I right? How to change it?

Best regards,
LUK

Here is my complete smb.conf:
# Samba config file created using SWAT
# from 192.168.1.172 (192.168.1.172)
# Date: 2008/06/21 14:57:31

# Global parameters
[global]
workgroup = MSHOME
netbios name = ASUS
server string = Samba Optware Server
log file = /opt/var/log/samba/log.%m
max log size = 50
load printers = No
dns proxy = No
hosts allow = 192.168.1.

[homes]
comment = Home Directories
read only = No
browseable = No

[printers]
comment = All Printers
path = /opt/var/spool/samba
printable = Yes
browseable = No

[tmp]
comment = Temporary file space
path = /tmp
read only = No
guest ok = Yes

[www]
comment = HTTP server files
path = /opt/share/www
read only = No
guest ok = Yes

[mariola]
path = /tmp

[luk]
comment = LUK's private
path = /tmp/mnt/disc0_4/luk
username = luk
valid users = luk
read list = mariola
write list = luk
read only = No
guest ok = Yes

Ade
08-07-2008, 21:07
Hi LUK,

In my [global] section I also have the following :-

security = user
encrypt passwords = yes
smd passwd file = /opt/etc/samba/smbpasswd

You then need to do a smbpasswd <user> for each of your users and this will be the password they use to access the share.

The only other thing I can think of is how are you trying to access the shares (Windows XP or Vista)? If you don't get a chance to enter a username/password I would guess it was your machine that's trying to access the share that's at fault not your Samba config. If you're using windows can you map a drive to the share and then force a username/password to see if that works.

Cheers

Ade