Samba authentication problem when attempting to connect from Windows client
Solution 1
The problem resolved itself when I removed the read-only option. Though from reading the documentation as my user was in write-list it should have overridden this setting.
Solution 2
I solved the problem at my server by noting the properties of the folder I was sharing. I had admin as the group and Bj as the user.
So, I entered into the configuration file in the section I wanted to share the following: force group = admin force user = Bj
Now all computers on my network can read and write to that folder.
Solution 3
- Are there authentication errors in the Samba logs?
- Do the files on disk have the proper permissions? If a file is read only on disk, it doesn't matter what you tell samba.
On a side note, if your user name in Windows and Linux is the same, then you don't need to add the user to the user map file.
Solution 4
You haven't told Samba how to do authentication. If this is a small server for yourself, you can use user security.
Add security = user
and encrypt passwords = yes
to the global section, then run 'smbpasswd cameron' to set your password for Samba. The password does not have to match your unix or windows password, though matching your windows password would make life easier.
Then restart samba and you should be able to login.
Related videos on Youtube
Camsoft
Updated on September 17, 2022Comments
-
Camsoft over 1 year
I've got a Linux server running Ubuntu and Samba. I've created two shares in Samba that point to directories that are owned by the user "cameron".
When I attempt to connect to these shares on Windows 7 is connects and allows me to see the files but they are read-only. This is the desired action for guest users but not for authenticated users.
My user on the Windows client is "Cameron" and has the same password as the Linux user "cameron".
I don't think my Windows user has authenticated against the Linux user. I even created a users.map file to map the user cameron (linux) to Cameron (windows) but still it does not work.
Here is my samba config file (UPDATED):
[global] server string = %h server (Samba, Ubuntu) map to guest = Bad User passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . username map = /etc/samba/users.map syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 os level = 65 preferred master = Yes dns proxy = No wins support = Yes usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d valid users = cameron write list = cameron [www] path = /usr/local/apache2/htdocs write list = @www-data force group = www-data guest ok = Yes [cameron] path = /home/cameron write list = @www-data force group = www-data guest ok = Yes
-
Camsoft almost 14 yearsOne thing to note is this file is generated via the Samba web interface swat.
-
-
Camsoft almost 14 yearsUnder swat I've selected USER security which is what I want. I think the reason it's not in the above config is because it's the default for Samba hence why swat has left it out. It's the same with encrypt passwords. Both are defaults. Do I need to logout and then back in again for Windows to attempt to authenticate?
-
Camsoft almost 14 yearsI can see the shares and browse them from Windows. The shares are owned by "cameron" and group "www-data". They have the following permissions:
rwxrwxr--
but when I attempt to create a file I get a "You need permission to perform this action" dialog. -
Camsoft almost 14 yearsThe reason for the map file was because the case was different and I was not sure if Linux is case-sensitive to usernames.
-
Camsoft almost 14 yearsJust removed the read-only lines and it appears to work now. I'm a little confused as I thought that adding my user to the write list would override this setting.