Hello Januszky --
Welcome to the fora! I hope your time in Linux Land, no matter which distribution, is ultimately a successful and positive experience. There's definitely a learning curve, but it sounds like you're already well aware of that.
Reading over your post, I noted that you're working on a no-password setup. This can be tricky with Samba, due to Samba's default user access mode being backed by the Unix-y user-based permissions model. That said, let's go over your smb.conf options and see what we can find. Here, I skip all options that look fine. I also link each listed option to the relevant section of the official Samba conf file online man page for reference -- if you have any questions at all about an option, this is what you want to read.
------------------------------------------------------------
[global]
security = user
This is already the default value. This line can thus be safely omitted from your conf file -- simple is good.
null passwords = true
This is *only* needed if you have Samba usernames explicitly defined with no passwords (using the sudo smbpasswd -a USERNAME command).
max log size = 50
The value here is the size of the log file in KB:
50KB seems quite small to me, but it's no biggie.Samba periodically checks the size and if it is exceeded it will rename the file, adding a .old extension.
...
Default: max log size = 5000
username map = /etc/samba/smbusers
This is key to your setup. From the man page:
The 'other' purpose mentioned here sounds exactly like what you're trying to do. Would you be so kind as to post the output of less /etc/samba/smbusers? Feel free to change the names to protect the innocent. The key point here is the local usernames you are mapping to, and whether the permissions on your shared folders are configured to allow access to those usernames.This option allows you to specify a file containing a mapping of usernames from the clients to the server. This can be used for several purposes. The most common is to map usernames that users use on DOS or Windows machines to those that the UNIX box uses. The other is to map multiple users to a single username so that they can more easily share files.
smb passwd file = /etc/samba/smbpasswd
Default value. Omitable.
name resolve order = hosts wins bcast
This is *almost* the default -- the default starts with lmhosts with the rest all the same. This is most likely omitable.
[private]
path = /usr/smbroot/private
A couple thoughts strike me here. First off, the /usr directory on Unix-y systems has traditionally been set aside for user applications and utilities, whereas the /home directory is more often used for user data. (More info here if you're interested.) This is neither here nor there with regard to Samba specifically, but it's something to think about in terms of how you want to organize your hard drive(s) and partitions. By way of an alternate example, I set up a separate /data directory into which I put all user data aside from settings files -- things like documents, music files, and the like. I also put this directory in its own partition -- this way I can wipe the root partition and install a completely different distro, and I don't have to worry about losing my data files (provided I'm careful with the partitions).
My second thought has more to do with your specific problems, and that is permissions -- it'd be very helpful if you could post the output of ls -l /usr/smbroot/private. This will allow us to see the owner, group, and access permissions for this directory, which could be part of what's causing your problems.
public = no
Synonym for guest ok. Default value. Omitable.
valid users = @private
write list = @private
These two together seem redundant -- the write list option is only relevant if you want to allow *some* users to access as read-only, and others as writeable. The valid users option defines only those users allowed to access this share. Your option values here make it look like you want to allow write access to everyone allowed to access at all -- so you can probably omit the write list line.
[public]
path = /usr/smbroot/public
Much like for your private directory, please post the output of ls -l /usr/smbroot/public.
write list = @public
With no valid users specification, *any* non-guest user that can log onto your Samba setup (i.e. any user properly mapped to a local Linux username in your smbusers file, since you specify one) will be able to read this directory, but only members of the public Linux group will be able to write to it.
[temp]
path = /usr/smbroot/tmp
Much like for your private directory, please post the output of ls -l /usr/smbroot/tmp.
public = yes
Synonym for guest ok. From the man page:
It's important to look into what your guest account is, if you have any intention of allowing guest users. The guest account can be specified in the smb.conf file by using the guest account [global] option. Note that the guest Samba account defaults to the nobody Linux user account, and this account usually has permission to access almost nothing in the filesystem, by default.If this parameter is yes for a service, then no password is required to connect to the service. Privileges will be those of the guest account.
------------------------------------------------------------
I suspect your problem comes down to filesystem permissions and username mapping. The command output requested above should provide some very useful clues to getting your config fully sorted out.
HTH,
-- Eiríkr
Bookmarks