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? |
Make sure the windows machine has a password.
try , Quote:
Quote:
|
Quote:
It works mounting with Windows. It works accessing via smbclient. But I can't access it from a mounted share. |
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. |
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 |
so basically what your saying is you access a directory just fine, but you cant access directory's above the directory you are in?
|
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.
|
Quote:
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? |
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. |
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 |
I'm afraid that makes no difference. The permission settings are definitely on the server side, not the client side.
|
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...
|
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. |