Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.