Tuesday, September 23, 2008

Cifs "mount error 13 = Permission denied"

$mount -t cifs //win-share-hostname/share /mnt/win -o username=user,password=passwd

Command above is used to mount windows network share on linux box but it is throwing an error mentioned below when trying to mount a win xp network share from a fedora core 6 box.
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
The error above is because of a bug in kernel which got in to the kernel version 2.6.18 and above. The same mount command works great for the kernel version 2.6.17 and below.
Bugzilla link to the bug: http://bugzilla.kernel.org/show_bug.cgi?id=7209

To avoid this error even in kernel version 2.6.18 and above. We need to use the network domain name with the mount command.

Working mount command irrespective of the bug is as below.

$
mount -t cifs //win-share-hostname/share /mnt/win -o username=user,password=passwd,domain=xxx

cheers,
make world open.

32 comments:

Stephan Samuel said...

This just started happening to me recently and the fix you listed above doesn't work. The share was mounting flawlessly until a couple days ago and now it fails every time. I changed nothing, although who knows what happened on its own.

Any thoughts?

Camilo said...

Great workaround! My system now mounts normally as it used to after adding the domain. I have been digging for an answer for hours until I found this posting!
I was about to kill my linux and downgrade!
Thanks!

Fiddles said...

Thanks! After much fussing, that was *most* of my problem and I had actually tried that myself just before I found your post, but I found an additional caveat: my password starts with a "$" and it wouldn't work specifying it in the options, but did when I left that out and entered it in the prompt. (Is there a way to escape the "$" or something?)

minoluchung said...

can anyone share with me " How to find the domain name in win2003? "

Arun George said...

Thanks vijay. It has helped me in solving this irritating problem with cifs.

Unknown said...

Mmm, your fix does not work for me. My kernel is 2.6.18-164.6.1. Any other ideas

Ekkehart Schlicht said...

My system returns

-t: command not found

What can I do?

Unknown said...

simple just add your domain=domainname at the end

Anonymous said...

If its in case of mounting Windows 7 shares I advice everybody just to turn off password protection.

Control Panel>Network and Sharing Centre>WorkGroup (left down corner) > Change Advanced sharing settings (i dont know if this is correct name im on polish windows) > When you go down you'll find "Password-protection sharing"

When you turn it off, you can on linux now do
sudo mount -t cifs -o sec=none //Win7ComputerName/Sharename /mounting/Point/OnLinux

After dozens of combinations it worked in my case

Anonymous said...

My problem was that the comma character (,) was part of my password. Switching to a comma-less password fixed it.

Unknown said...

but if we are using the ip address of particular machine that why we have to mention the domain name

Unknown said...

but if we are using the ip address of particular machine that why we have to mention the domain name

Unknown said...

but if we are using the ip address of particular machine that why we have to mention the domain name

Pradeep said...

Thanks... It really Helped ..

Pradeep said...

thanks

Anonymous said...

Works great... thanks

amitkads said...

Thanks dude...it saved my time...

Unknown said...

Hi,
But I am getting the below error:

[root@indls00xx ~]# sudo mount -t cifs //indws00yy/jata /root/win/ -o username=\v.kumar3,password=xxx,domain=
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
[root@indls00xx ~]#


Thanks-
Shankar

Fritz Katz said...

If you've used SAMBA to mount a Windows share, and you've changed your Windows password, remember to change the password stored in the /etc/fstab.

then a simple:

% sudo mount -a

works. (Well, it worked for me.)

John McLean said...

thanks! worked on Centos 5.6

pawel said...

Check also username and password, if e.g.: on linux you are logged on as root and on the windows as a Tom, user should be set to Tom not root

Unknown said...

works well...Thanks for the help

Gil said...

Thanks dude, what a simple resolution worked like this.... great thank you


subbu

Balaji Ramakrishnan said...

Thanks a lot :)

Anonymous said...

helped me too...
using username=user,domain=dom instead of username=dom\username did the tric...
Thanks.

Anonymous said...

very helpfull blog thank you

Anonymous said...

Solved my problem. Thanks for the post.

Nirmal said...

Solved my problem, thanks for the post.

Anonymous said...

thank you! works for me!

Logical Maniac said...

Great...Thank you very much ... resolved.

Anonymous said...

Solved my problem, too. Thanks for the help.

Anonymous said...

Thanks Vijay...