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?


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.

  • guess it's the $HOME which is listed on ´env´ - also .profile and .bashrc – Martin Zeitler 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.

  • My symptom: I could log onto a share from any machine (from Win 7 and 10) except my own ...it was driving me crazy! What had happened was that earlier, to test another user's access, I had mapped the share on my machine and used "connect using different credentials". Even though i had long since removed the mapping, the user's credentials persisted and did not have rights to access the share I was now trying to access. I followed your advice above plus adding single important step - "I then logged off and logged back on" - and everything worked. Thank you! – Pancho Dec 20 '16 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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