Samba as part of an NT domain - net use fails with " does not exist or permission denied"

Posted on 2009-05-19
Last Modified: 2013-12-16
I built an "NAS" box with a large RAID array and I need to share it to clients on an existing Windows NT domain so they can map to various shares using their existing NT domain user names and passwords (without me having to add them as LINUX users). I also would like to install Netware emulation, but that is another story :-)

I have CentOS release 5.3 and Samba version 3.0.33-3.7.el5 .

I got everything installed, but when I try to map a drive from a windows box to the share I made I get:

  '/data/backup' does not exist or permission denied when connecting to [backup] Error was Permission denied

I followed the troubleshooting guide here:

and everything seems to work as expected until I try to map MY share.  I added the /tmp share as they show in their example and I CAN map to that (it does not even require a password) but when I try to map to the share I NEED to use it does not work. /tmp is drwxrwxrwt so I made my to be shared folder (/data/backup) the same - still no go. Both show root as owner:group, but I have tried many different "owners" and always get the same result.

I have tried to simplify my smb.conf for testing, so running testparm smb.conf produces:

Load smb config files from smb.conf
Processing section "[printers]"
Processing section "[backup]"
Processing section "[tmp]"
Loaded services file OK.
Press enter to see a dump of your service definitions
        workgroup = DOMAIN_NAME
        server string = 'NAS Server'
        security = DOMAIN
        password server = PRIMARY_NT_DOMAIN_CONTROLLER_NAME
        load printers = No
        cups options = raw

        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No

        comment = Backup Folder
        path = /data/backup

        comment = temporary files
        path = /tmp

I removed stuff like valid users = @DOMAIN_NAME\users from my share, since the problem seems to be permissions at the LINUX level with the folder I want to share.

If I issue the command

net use W: \\NAS\tmp /USER:DOMAIN_NAME:any_user

from a box on the domain it maps right up and the log shows

  machine_name ( connect to service tmp initially as user DOMAIN_NAME\user_name (uid=10000, gid=30000) (pid 11504)

It did not ask for a password.

If I delete that mapping and try:

net use W: \\NAS\backup /USER:DOMAIN_NAME:any_user

I am prompted for a password. If I use the wrong password, I get

System error 1326 has occurred.
Logon failure: unknown user name or bad password.

on the windows box - so it knows I missed the password. There is no entry in the smbd.log when I do this.  So I try again with the correct password and I get:

System error 87 has occurred.
The parameter is incorrect.

on the windows box and get this in the smbd.log

  '/data/backup' does not exist or permission denied when connecting to [backup] Error was Permission denied

What am I doing wrong?  I added another new share, but did not make the folder and I get the same error as I get when trying to map the share that DOES exist. I made a share for the /etc folder as a test, and that worked.  The /tmp and /etc are on the "OS volume" (/dev/hda3 with about 52 gb available) which is an IDE hard drive. The other shares are on the RAID array, if that matters. This is /dev/sda1 and has 1.1 tb available.  I tried sharing a LINUX user's home folder and I get the same error (but its permission is drwx------ so that might be "normal"


Question by:dlwynne
  • 3
  • 2
LVL 27

Expert Comment

ID: 24432435
1)add to [global]:
log level = 3

and restart samba

2) check that directiry permissions on '/data' are also OK (not only on /data/backup)
LVL 20

Expert Comment

by:Daniel McAllister
ID: 24433727
Permissions on /          must include other execute (d--x--x--x is a minimum)
Permissions on /data  must include other execute (d--x--x--x is a minimum)
Permissions on /data/backup must ALSO include READ permissions (and write, if Samba is to write files to it... (drwxrwxr-x would be a workable minimum)

What I mean by a MINIMUM above is that those r's & x's MUST be there, and the -'s may be replaced with optional r's & w's if you want/need them.

It is also possible that /data/backup is a symbolic link to someplace that doesn't have full execute-path permission (so you'll get the same error).

It is also possible that the filesystem that houses /data/backup may be corrupt -- do an "ls -al /data/backup" and make sure that . and .. appear (as a minimum).

The additional logging created by the above suggestion may help if these don't reveal the issue...

I hope this helps...


Accepted Solution

dlwynne earned 0 total points
ID: 24434090
/data is also drwxrwxrwt  as are the directories under it.

Here is the strange part, it is now working (it seems). I have to put everything back as it was.  While waiting for help on this topic I started working on the mars_nwe install and I had to get a newer kernel that supports IPX so I am now on 2.6.18-128.1.10.el5.centos.plusPAE .

It could have been something else I did last night or just the kernel update?  I don't know, but I can map to the shares for folders I made now.  I have to double check that only valid domain users that authenticate can connect, but it looks good so far.

I  can see my real NW servers from the Centos box, but I can't see the NWE on the Centos from any NW clients. I feel a new EE question comeing on  :-)
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

LVL 20

Expert Comment

by:Daniel McAllister
ID: 24434580
The "t" at the end of the directories was put there for tmp so that files in a "shared" folder would be protected from users OTHER THAN the creator (of the file).... it is referred to as a "sticky-bit", but that's not the real use here.
The result is that userB cannot remove a file created by userA in the folder unless userB has write permission to the file.
Suppose /tmp looks like this:

drwxrwxrwt   3  root     root     20480   May 20 12:00  .

dr-x--x--x  30  root     root      4096   Jan  1  1997  ..

-r-xr-xr-x   1  userA    userA        5   May 20 12:01  file

Open in new window

LVL 20

Expert Comment

by:Daniel McAllister
ID: 24434599
OOps... my bad on the submit there...
In any case, with the code snippet above, userB CANNOT remove the file (file) EVEN THOUGH they have write permission on the directory, because they do not also have write permission on the FILE (file) while the sticky-bit is on.
I bring this up because that MAY NOT be the behavior you want on your backup folder (then again, it may be... but you should know).
I'm glad its working...

Author Comment

ID: 24434621
That is what I wanted. The backup share (for example) is for image backups of workstations and there is no problem having other users see or even access the backup images of others, I just don't want them to be able to delete a file or directory belonging to someone else - thus the sticky bit.  I tested, and that part works too.

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Join & Write a Comment

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Hello, As I have seen there a lot of requests regarding monitoring and reporting for exchange 2007 / 2010 / 2013 I have decided to post some thoughts together and link to articles that have helped me. Of course a lot of information you can get…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now