LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problem mounting subdirectories with Samba (https://www.linuxquestions.org/questions/linux-networking-3/problem-mounting-subdirectories-with-samba-926381/)

avidscavenger 01-29-2012 07:09 PM

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?

cbtshare 01-30-2012 03:21 PM

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)

avidscavenger 01-30-2012 10:00 PM

Quote:

Originally Posted by cbtshare (Post 4588664)
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.

cbtshare 01-31-2012 01:30 AM

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.

avidscavenger 01-31-2012 07:22 PM

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

cbtshare 01-31-2012 10:57 PM

so basically what your saying is you access a directory just fine, but you cant access directory's above the directory you are in?

avidscavenger 01-31-2012 10:59 PM

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.

cbtshare 01-31-2012 11:51 PM

Quote:

Originally Posted by avidscavenger (Post 4588928)
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?

avidscavenger 02-01-2012 12:03 AM

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.

cbtshare 02-02-2012 05:04 AM

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

avidscavenger 02-02-2012 08:01 PM

I'm afraid that makes no difference. The permission settings are definitely on the server side, not the client side.

cbtshare 02-02-2012 10:14 PM

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

avidscavenger 02-02-2012 10:28 PM

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.


All times are GMT -5. The time now is 01:30 AM.