Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question
    
One thing to note is this file is generated via the Samba web interface swat. –  Camsoft Jul 22 '10 at 12:15

4 Answers 4

  • 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.

share|improve this answer
    
I 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 Jul 22 '10 at 16:02
    
The reason for the map file was because the case was different and I was not sure if Linux is case-sensitive to usernames. –  Camsoft Jul 22 '10 at 16:09
    
Just 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. –  Camsoft Jul 22 '10 at 16:09

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.

share|improve this answer
    
Under 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 Jul 22 '10 at 12:48

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.

share|improve this answer
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.