The Windows user should also have an account on Linux, and you should use the "smbpasswd" command to enter the username and password. This will create an entry in the /etc/samba/smbpasswd file. This file is similar to the /etc/passwd file. The entry in the file is used to authenticate with samba or windows. The entry in Linux's /etc/passwd file contains your Linux username and the UID (user ID). The kernel uses the UID to determine whether you have permission to read or write files on a Linux filesystem.
There are different password backends that Samba might use. The smbpasswd file is the most basic and the default. It is fine to use it if you have fewer than 20 users. Check your /etc/samba/smb.conf file to make sure that you aren't using a different password backend.
Quote:
Originally Posted by man smb.conf
Available backends can include: - smbpasswd - The default smbpasswd backend. Takes a path to the smbpasswd file as an optional argument.
- tdbsam - The TDB based password storage backend. Takes a path to the TDB as an optional argument (defaults to
passdb.tdb in the private dir directory.
- ldapsam - The LDAP based passdb backend. Takes an LDAP URL as an optional argument (defaults to ldap://localhost)
|
Other information you haven't supplied is the security mode. I'm guessing that "security = user", which is the default, is what you have.
You also haven't posted the definition of the samba service, or the permissions on the directory being shared.
For example, if you are sharing your own home directory, only you should have permission access the share and to read and write to both the directory and the samba share. If on the other hand you want a globally writable service, it would be better to create a directory with global permissions.
Example:
Code:
sudo mkdir /srv/samba/share
sudo chmod ugo=rwxt /srv/samba/share
In the main section of smb.conf, then use "map to guest = Bad User". Then use a share definition like this:
Code:
[Share]
path = /srv/samba
guest ok = Yes
read only = No
This will allow any user to access the share and read and write files there. If the user is authenticated (i.e. a samba user and a linux user) then the file will be owned by the user. Otherwise the file will be owned by the user "nobody" which samba maps to the Windows user "guest". The sticky bit set on the directory being shared will prevent one (authenticated) user from deleting the file owned by another. The permissions on the file (created by the owner) can protect the file against reading and/or writing.