Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I setup a samba server on 12.04 LTS, and it works great for one user but not the others.

I am trying to map a network drive from a windows 7 laptop. I can successfully authenticate with one user, but the other two both get "Access is denied" errors.

Here is my smb.conf file.

    server string = %h server (Samba, Ubuntu)
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    idmap config * : backend = tdb

    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    print ok = Yes
    browseable = No

    comment = Printer Drivers
    path = /var/lib/samba/printers

    comment = Ubuntu File Server Share
    path = /srv/share
    read only = No
    create mask = 0755

I know that the service is successfully reading from the /etc/passwd file because if I change the Linux password for the user that works, I have to use the new password when I connect.

I changed all the users so they are all members of the same groups (all three users are admins anyway).

I only ever have one user connected at a time.

Here are the permissions on the shared folder

/srv$ ls -l
drwxrwxrwx 1 nobody nogroup 16 Feb 22 17:05 share

Any ideas?

share|improve this question

It turns out that in order to enable samba sharing for a user when using "security = user", the user has to log into the box at least once. I don't know what environmental variables get setup the first time they log in, but once I logged into the box it worked fine.

share|improve this answer
guess it's the $HOME which is listed on ´env´ - also .profile and .bashrc – syslogic May 10 '13 at 12:33

In my case, one windows user cannot connect to samba, though several other windows users could. The one user, who used to work, timed out when trying to access the share at

//machine name

And got this error:

You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions. The user name could not be found.

What fixed this user was deleting the saved user-name and password from Windows. By Going through this steps :

Control Panel; User Accounts; Advanced tab; Manage Passwords. I found the server name listed and deleted it. Then instead of a timeout, I got a fresh login and was able to login successfully.

share|improve this answer

Your Answer


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.