Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-19
6
Medium Priority
?
878 Views
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:

 smbd/service.c:make_connection_snum(1003)
  '/data/backup' does not exist or permission denied when connecting to [backup] Error was Permission denied

I followed the troubleshooting guide here:
http://us5.samba.org/samba/docs/man/Samba-HOWTO-Collection/diagnosis.html

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.
Server role: ROLE_DOMAIN_MEMBER
Press enter to see a dump of your service definitions
[global]
        workgroup = DOMAIN_NAME
        server string = 'NAS Server'
        security = DOMAIN
        password server = PRIMARY_NT_DOMAIN_CONTROLLER_NAME
        load printers = No
        cups options = raw

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

[backup]
        comment = Backup Folder
        path = /data/backup

[tmp]
        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

 smbd/service.c:make_connection_snum(1033)
  machine_name (192.168.0.109) 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

 smbd/service.c:make_connection_snum(1003)
  '/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"

Thanks!




0
Comment
Question by:dlwynne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:Nopius
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)
0
 
LVL 21

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

Dan
IT4SOHO
0
 

Accepted Solution

by:
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  :-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 21

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

0
 
LVL 21

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...
 
Dan
IT4SOHO
0
 

Author Comment

by:dlwynne
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.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever stumbled upon a software that is so great that you just love? It happened to me. Love at first sight. Filezilla Server.   Ok its not the most advanced ftp server I've came across. But its a fairly simple piece of software to get the …
Determining the an SCCM package name from the Package ID
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

609 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