6

I know this question has been asked before, but I've been looking for a solution for a couple of hours now and nothing seems to be working.

The frustrating thing is that it used to work on my previous install, so I know the commands I try should work.

I'm running a vanilla install of Ubuntu 13.04 server.

I have a server running at 192.168.1.130 and two shares: LaCie and Seagate 2TB.

I used to have these lines in my fstab file:

//192.168.1.130/Seagate\0402TB /home/Windows cifs user=admin,password=password,uid=1000 0 0

Now that I re-installed my server, but don't need it permanently I tried the following:

sudo mount.cifs //192.168.1.130/LaCie ~/lacie -o user=admin

or

sudo mount -t cifs -o username='admin',password='<password>' //192.168.1.130/LaCie ~/lacie

However, I get the error mount error(13): Permission denied.

I'm sure the credentials are correct. Nothing has changed at the windows side.

Also, I installed the packages samba, cifs-utils too. Nothing helped.

6
  • Can you try user=admin instead of username=admin, and without the ' apostrophe? Also, can you add the user option too? So sudo mount -t cifs -o user,user=admin,password=password //192.168.1.130/LaCie ~/lacie.
    – Alaa Ali
    Aug 25, 2013 at 18:04
  • This admin user is a local user right? Maybe you need to add the workgroup or the domain to it. Also, this thread over at the Ubuntu Forums seems to have a lot of info. Adding the option sec=ntlm or sec=ntlmv2 seems to solve the issue for some.
    – Alaa Ali
    Aug 25, 2013 at 18:14
  • Also, does this work if you prefix the command with sudo?
    – Mordoc
    Aug 25, 2013 at 21:42
  • Allright, I've got the following command to work, but in /etc/fstab it's still nothing :( sudo mount -t cifs -o username='administrator',password='<pwd>' //192.168.1.130/seagate /home/seagate Aug 27, 2013 at 11:25
  • 1
    Hi @ChristopheDeTroyer! Can you please post this as an answer to the question? You can answer your own question; in fact, it is encouraged to do so.
    – Alaa Ali
    Sep 15, 2013 at 18:16

7 Answers 7

13

i had this same error. what solved it for me is reverting mount.cifs's security parameter back to its previous default as indicated here and in mount.cifs' manpage:

The default in mainline kernel versions prior to v3.8 was sec=ntlm. In v3.8, the default was changed to sec=ntlmssp.

in your case, the new command would be

sudo mount.cifs //192.168.1.130/LaCie ~/lacie -o user=admin,sec=ntlm

notice sec=ntlm at the end

2
  • 1
    Actually using ntlmssp solved it for me, as my default was already ntlm. Thanks a lot! Nov 26, 2014 at 10:41
  • This wasn't the problem in my case, but it pointed me to the real one - time lag on my Windows machine as described in my answer. +1 and thanks.
    – mcmlxxxvi
    Feb 14, 2016 at 9:03
2
//192.168.1.130/seagate /home/seagate cifs username=administrator,password=<pwd>,uid=1000 0 0 

This solved the problem! (i.e., leave the quotation marks out!)

2

In my case, it turned out to be time issues on the Windows machine - it has some problem where its time lags severely, in the range of 2 days per week (most likely the motherboard battery needs replacing). I manually updated the time and mount succeeded.

Arch Linux machine connecting to a Windows XP one, but I'd suspect it would be a problem for Ubuntu to newer Windowses as well.

1

I am using Ubuntu 14.04.1 LTS after upgrading and had the same problem

What I did to immediately remap the network folder was:

mount -t cifs //Server/Folder/ /mnt/MapedFolder -o domain=contoso.local,username=user,password=pass,sec=ntlm

Hope it helps others

1
  • The important missing param for me was sec=ntlm from an ARM running lubuntu, which I didnt need from a Fedora Desktop on x64
    – Octopus
    Jan 10, 2015 at 6:52
1

Thanks to the answers above, I was able to mount my Seagate personalCloud onto my raspberry Pi. I slightly tuned the commands above like this:

=> for the Public folder: sudo mount -t cifs -o noperm //192.168.1.x/Public /home/pi/Documents/PATH

=> for the private folder (needs the username/pwd): sudo mount -t cifs -o username=<USERNMAE>,password=<PWD> //192.168.1.x/<PRIVATEFOLDERNAME> /home/pi/Documents/PATH

I can now browse through the Seagate PersonalCloud like a normal disk!

1

I had this issue as well. I'm using centos (rpm based). I was getting mount error(13): Permission denied as well. Then I discovered that the problem was caused by SELinux (the lack of public_content_t context type) and of course the samba user smbpasswd -a <user> should have ownership of the directory.

  • semanage fcontext -a -t public_content_t "/mydir(/.*)?" - adding public_content_t, verify using ls -lZ. Alternatively, turn off the selinux - setenforce 0 (runtime), edit either /etc/sysconfig/selinux or /etc/selinux/config by adding/altering SELINUX=disabled (permanently)
  • chown :user1 /mydir && chmod +0070 /mydir - giving an access for group, the member of which the samba user is.
0

For me the fstab mount was failing because setting the _netdev option reports eth0 up and running prior to dhcp completing. This causes the mount to run prior to having an IP address from DHCP.

I'm using a raspberry pi on Jessie OS. My solution was

sudo raspi-config

and selected the option 4 to wait for the network config to finish prior to finishing boot (and prior to mounting cifs folders). Fixed it for me. See also: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=124673

enter image description here

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .