Ubuntu – cifs, smb – Can’t mount (permission denied) or navigate shared folder

cifsmountpermissionssamba

I've recently bumped into this problem. I usually navigate through a local network shared folder from a Linux machine via smb (i.e. from file manger using smb: ).
Now whenever I try to access the shortcut or typing credential again I keep getting the dialog window asking for user, domain and password.

So I tried mounting the location manually using cisf-utils doing:

sudo mount -t cifs //fileshare1/docs1/user/My\ Documents/shared/Francesco/ /home/frank/used_shared/ -o username=my_user,password=my_pass,domain=my_domain,gid=1000,uid=1000

I get mount error(13): Permission denied.

I'm definitely sure my user has permission on that folder cause I can access it from a windows machine.

Also if I try to mount my personal folder on that location through:

sudo mount -t cifs //fileshare1/docs5/francesco.azzarello/ /home/frank/mnt_folder -o username=my_user,password=my_pass,domain=my_domain,gid=1000,uid=1000

I can access it with no problem.

For reference I'm using 4.2.0-36-generic kernel and my mount.cifs version is 6.4

Any idea on how to make one of both methods work?


Update Rgarding ponsfrilus answer

number 1: verbose option returns:

_mount.cifs kernel mount options: ip=xxx.xxx.xxx.xxx,unc=\\fileshare1\docs1,uid=1000,gid=1000,user=my_user,,domain=my_domain,prefixpath=user/My Documents/shared/Francesco/,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)_

Number 2 is basically the same thing:

_ mount.cifs kernel mount options: ip=xxx.xxx.xxx.xxx,unc=\\fileshare1\docs1,iocharset=utf8,file_mode=0777,dir_mode=0777,user=my_user,,domain=my_domain,prefixpath=user/My Documents/shared/Francesco/,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)_

And nothing changed with vers=2.1:

_mount.cifs kernel mount options: ip=xxx.xxx.xxx.xxx,unc=\\fileshare1\docs1,vers=2.1,iocharset=utf8,file_mode=0777,dir_mode=0777,user=my_user,,domain=my_domain,prefixpath=user/My Documents/shared/Francesco/,pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)_

As for number 4 I can mount docs1 no problem but I can navigate tho get to the shared folder in user.

Best Answer

I'm pretty sure I ran into this exact same problem today on Ubuntu 16.10 I tried all the suggestions in this thread several times, I could mount the exact same share using Windows Server 2016 and I could browse it using smbclient (smbclient -U brainstrust //WINBOX01/shared). I even tried an external credentials file.

I ended up stumbling on a fix - although I'd created a local user for the share on the Windows box, it was also joined to a domain. Basically setting the domain to be the local machine -o domain=WINBOX01 fixed my problem instantly, so leaving a comment here in the hope that its useful to someone out there.

The complete minimal command I used was:

sudo mount.cifs -v //WINBOX01/shared /home/geoff/winbox01  --verbose -o user=brainstrust,password=topsecret,domain=WINBOX01