LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2012, 07:09 PM   #1
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Rep: Reputation: Disabled
Problem mounting subdirectories with Samba


I'm having a problem mounting a directory on a Windows server that looks different from any that I can find already described. The particularity is that some of the intermediate directories are not accessible (network administration policy over which I have no control) and this seems to prevent me from accessing the directory which is accessible.

First things first, I'm running Debian unstable and have confirmed this behaviour with smbmount version 5.2 and smbclient version 3.6.1

So what happens? If I access the share drive using smbclient (I'm covering my tracks by changing domains and other identifying features, but otherwise this is a real case):

smbclient -W DOMAIN -U user@password //server.domain.com/share
smb: \>cd Level1
cd \Level1\: NT_STATUS_ACCESS_DENIED <--- intermediate directory inaccessible, but...
smb: \>cd Level1/level2/user
smb: \>ls
... everything is there

BUT if I try to mount that same directory //server.domain.com/share/Level1/level2/user using smbmount or mount.cifs:

sudo smbmount //server.domain.com/share/Level1/level2/user /mnt/point -o dom=DOMAIN,user=user,pass=password
mount error(13): Permission denied

OR

sudo smbmount //server.domain.com/share/ /mnt/point -o prefixpath=Level1/level2/user,dom=DOMAIN,user=user,pass=password
mount error(13): Permission denied

Any suggestions or insights?
 
Old 01-30-2012, 03:21 PM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
Make sure the windows machine has a password.

try ,

Quote:
smbclient -L IPADDRESS(Of the windows machine)
then add the share:

Quote:
mount -t cifs -o username=XXXX,password=XXXX //IPADDRESS(windows machine)/shareName /mnt/(place you want to mount on linux)
 
Old 01-30-2012, 10:00 PM   #3
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cbtshare View Post
then add the share:
That all works. But it doesn't help me access the directories under the share, because I don't have access to /Level1 or to /Level1/Level2 but only to /Level1/Level2/User.

It works mounting with Windows. It works accessing via smbclient. But I can't access it from a mounted share.
 
Old 01-31-2012, 01:30 AM   #4
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
if you can mount the share just fine on linux, but cant access sub-directories of the share then its a permissions issue.

Can you map the share on a windows computer and view sub directories with the same user you are logging in with on the linux box?

If you right click the windows share and click security and then advanced you will see if the user you are logging in with has rights to log into the subdirectories of the folder you are sharing.

If all else fails, try accessing the windows box from the GUI on linux, via places then Network and windows network.
 
Old 01-31-2012, 07:22 PM   #5
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Under windows the behaviour is completely consistent with that under Linux. That is, I can see the top level share, but not the intermediate directories Level1 and Level1/Level2, and once again Level1/Level2/user.

The point, it seems to me, is that the server is set up to allow access only only to the director nested 3 levels below the share. If you go "straight" there, then everything is fine, but if you try to access the intermediate levels you get blocked. Thus Windows works fine, as does smbclient, but not smbmount/mount.cifs
 
Old 01-31-2012, 10:57 PM   #6
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
so basically what your saying is you access a directory just fine, but you cant access directory's above the directory you are in?
 
Old 01-31-2012, 10:59 PM   #7
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
I wouldn't say 'just fine' because I can't mount it. That's the issue. I don't want access to the higher level directories, I just want to be able to mount my directory.
 
Old 01-31-2012, 11:51 PM   #8
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
Quote:
Originally Posted by avidscavenger View Post
That all works. But it doesn't help me access the directories under the share, because I don't have access to /Level1 or to /Level1/Level2 but only to /Level1/Level2/User.

It works mounting with Windows. It works accessing via smbclient. But I can't access it from a mounted share.
So in my post to which you gave the above response you said it all works, so I am taking that to mean

mount -t cifs -o username=XXXX,password=XXXX //IPADDRESS(windows machine)/shareName /mnt/(place you want to mount on linux)

command works but you then cant then access the share correct?
 
Old 02-01-2012, 12:03 AM   #9
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
The mount command works, ie returns no error code. But I can't access anything useful. I can see the subdirectories of the share, but neither the contents of Level1 (I don't expect to), Level1/Level2 (I don't expect to either ) nor Level1/Level2/user (which I do expect to, can under Windows and can using smbclient).

Sorry my answer to the last question may have been a little unclear. I don't really care whether I mount //server/share, then access <mountpoint>/Level1/Level2/user or whether I mount //server/share/Level1/Level2/user and access <mountpoint>. If I try the first option, the mount works but the access doesn't. If I try the second option then the mount fails.
 
Old 02-02-2012, 05:04 AM   #10
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
Ok, so I did some reading.Try adding this command with the mount iocharset=utf8,file_mode=0777,dir_mode=0777:

Code:
mount -t cifs //ipaddress/sharefolder ~/Share/ -o username=username,password=password,iocharset=utf8,file_mode=0777,dir_mode=0777

Last edited by cbtshare; 02-02-2012 at 05:05 AM.
 
Old 02-02-2012, 08:01 PM   #11
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
I'm afraid that makes no difference. The permission settings are definitely on the server side, not the client side.
 
Old 02-02-2012, 10:14 PM   #12
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
Yes, I understand that, but if you say you login with a windows computer with the same username and password and can access the share fine, then it wouldn't be logical that it wouldn't work on linux.More info maybe needed on the network it seems...

Last edited by cbtshare; 02-02-2012 at 10:39 PM.
 
Old 02-02-2012, 10:28 PM   #13
avidscavenger
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sure, but my point was that explicitly setting file_mode and dir_mode on the client side isn't going to change anything on the server side.

I agree that it isn't logical that I can't access the directory under the mounted share under Linux. The best explanation I can think of is that the samba code doesn't consider the possibility that subdirectories of an inaccessible directory may be accessible. I'm guessing that it's attempting to access those intermediate level directories, and giving up when the server won't allow that. Possibly I can enable some debug output to confirm this. A bit busy I'm afraid to try that right now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Enforce user and group ownership in subdirectories of a Samba share jillges Linux - Server 1 12-29-2011 03:55 PM
samba mounting problem Piro Linux - General 7 04-23-2006 07:06 PM
smbmounting subdirectories of samba shares kulmis Linux - Software 1 12-11-2005 03:03 PM
Samba Mounting Problem AmdMhz Linux - Networking 2 10-27-2004 02:08 PM
samba mounting and umounting problem urkhaa1975 Linux - Networking 0 07-30-2004 04:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration