Failed to mount windows share permission denied

ошибка монтирования 13 = Отказано в доступе

Один из моих серверов настроен на автоматическое монтирование каталога Windows с помощью fstab. Однако после последней перезагрузки он перестал работать. Строка в fstab:

Я делаю, mount -a и я получаю mount error 13 = Permission denied . Если я сделаю это достаточно, он заблокирует мою учетную запись Windows, поэтому я знаю, что она пытается. Я проверил, что мой пароль правильный.

Что я делаю не так?

Несколько вещей, чтобы проверить. Я делаю нечто подобное, и вы можете протестировать монтирование напрямую, используя mount команду, чтобы убедиться, что все настроено правильно.

Разрешения на файл учетных данных

Убедитесь, что этот файл разрешен правильно.

Многословное крепление

Вы можете получить больше информации, mount используя -v переключатель, который часто показывает вам, где что-то происходит.

Результатом этого вывода, если он работает:

Проверьте логи

После выполнения вышеупомянутой команды монтирования загляните в свои файлы dmesg и / /var/log/messages или на /var/log/syslog наличие сообщений об ошибках, которые могли быть сгенерированы при попытке mount .

Тип безопасности

Вы можете передать много дополнительных опций через -o .. переключатель для монтирования. Эти параметры зависят от технологии, поэтому в вашем случае они применимы к mount.cifs конкретным. Взгляните на mount.cifs справочную страницу, чтобы узнать больше обо всех возможностях, которые вы можете передать.

Я подозреваю, что вы упускаете возможность sec=. . В частности, один из этих вариантов:

Вы , возможно , потребуется настроить sec=. параметр так , что это либо sec=ntlm или sec=ntlmssp .

Ubuntu Local Network Share — Failed to mount Windows share: Permission denied

I’ve just set up a home server running Ubuntu 19.04 with a dedicated hard drive for file sharing (Ubuntu is installed on a separate drive). Both drives are formatted with ext4.

On the dedicated hard drive I’ve created a share, which looks like this.

On my workstation I can see the share listed. I’ve tried to access it using both Anonymous and Registered User methods.

. but no such luck.

1 Answer 1

The two most common causes of your error message are:

[1] You are not passing the samba password when asked for the «registered user» credentials.

Читайте также:  Windows 10 домашняя загрузить

You create that password by adding the user to the samba password database — and I will use my own as an example:

[2] Since the share that was created allows guest access the more likely case is the path to the shared directory does not allow access to the shared folder. The shared folder itself may allow access to guest but the path to that folder may not. For example if the folder is mounted to /media/morbius/Media then only morbius will have access to Media.

I would suggest that you edit your original question and add to it the output of the following command so the folks here can see where the folder is located:

mount error 13 = Permission denied

One of my servers is set up to automatically mount a Windows directory using fstab. However, after my last reboot it stopped working. The line in fstab is:

The .Smbcredentials file is:

I do a mount -a and I receive mount error 13 = Permission denied . If I do this enough it will lock out my Windows account, so I know it’s trying. I’ve checked that my password is correct.

What am i doing wrong?

5 Answers 5

A couple of things to check out. I do something similar and you can test mount it directly using the mount command to make sure you have things setup right.

Permissions on credentials file

Make sure that this file is permissioned right.

Verbose mount

You can coax more info out of mount using the -v switch which will often times show you where things are getting tripped up.

Resulting in this output if it works:

Check the logs

After running the above mount command take a look inside your dmesg and /var/log/messages or /var/log/syslog files for any error messages that may have been generated when you attempted the mount .

Type of security

You can pass a lot of extra options via the -o .. switch to mount. These options are technology specific, so in your case they’re applicable to mount.cifs specifically. Take a look at the mount.cifs man page for more on all the options you can pass.

I would suspect you’re missing an option to sec=. . Specifically one of these options:

You may need to adjust the sec=. option so that it’s either sec=ntlm or sec=ntlmssp .

Linux Mint Forums

Welcome to the Linux Mint forums!

Samba | Failed to mount Windows share: Permission denied

Samba | Failed to mount Windows share: Permission denied

Post by Boarnads » Wed Feb 18, 2015 1:29 am

I’ve been trying to setup samba via webmin and have run into several permission problems. I’m trying to setup several shares that require no authentication.
Below are the current problematic shared folders and their status:

‘/media/username/My Book’
Visible in network but get the following when trying to access it

Читайте также:  Windows не обнаруживает модем

‘/home/username/Videos’
I can access this from the network but I cannot access any of the individual files, I can only browse through the folders.

‘ls -l’ gives me the following
drwx—— 1 username username 8192 Feb 17 02:18 My Book
drwxr-xr-x 9 username username 4096 Feb 18 04:48 Videos

I also tried chmod 777 for My Book prior to ls -l command, it appeared to complete successfully although the permissions dont seem to have changed.

Any help in resolving this issus would be greatly appreciated
Regards,
Boarnads

Re: Samba | Failed to mount Windows share: Permission denied

Post by Pjotr » Wed Feb 18, 2015 5:26 am

Works flawlessly with my own NAS.

Re: Samba | Failed to mount Windows share: Permission denied

Post by altair4 » Wed Feb 18, 2015 7:19 am

You might be able to fix both problems by forcing the remote quest to appear to be you — at least for your samba shares anyway:

Edit smb.conf and under the workgroup = workgroup line add this line:

I’m using your reference to «username» so change that to whatever your real user name is.

Then restart smbd:

Re: Samba | Failed to mount Windows share: Permission denied

Post by kwisher » Wed Feb 18, 2015 2:36 pm

Is the MyBook formatted as NTFS? This could be the problem as NTFS doesn’t work with Linux permissions, iirc.

altair, please correct me if I am all wet.

Re: Samba | Failed to mount Windows share: Permission denied

Post by altair4 » Wed Feb 18, 2015 3:31 pm

Re: Samba | Failed to mount Windows share: Permission denied

Post by Aristotelian » Wed Feb 18, 2015 5:28 pm

Re: Samba | Failed to mount Windows share: Permission denied

Post by Boarnads » Wed Feb 18, 2015 9:45 pm

The hdd is NTFS but Ive gotten the shares to work before with NTFS drives without the ‘force user’, I just cant remember what I did.
However I’m now using ‘force user = username’ which seems to have fixed the problem, I’m just wondering are there any negatives to ‘force user’, would I be better off getting the permissions working, especially for the ‘Videos’ share?

Thank you all very much for your help.

Re: Samba | Failed to mount Windows share: Permission denied

Post by altair4 » Thu Feb 19, 2015 7:47 am

Warning: This is going to be an unbelievably long answer

Let’s take the worst case scenario and assume the client machine is running Windows and that the user on that machine is named «bob».

When bob tries to access your Mint machine Windows automatically passes his user name to Samba. If there is no match in the samba password database for «bob» the «map to guest = Bad User» parameter is invoked and changes «bob» to the default guest user in Mint which is literally «nobody».

Читайте также:  Wireshark windows 64 bit

«nobody» doesn’t have access to «/media/username/My Book» at all ( actually no one has access to that folder except «username» ) and only has read access to /home/username/Videos. «force user» makes «nobody» «username» so he now does have access to both. Depending on how you create the samba share definition it still has a gatekeeper function in that if you set it up to be read only the Windows client cannot write even though he is now «username».

If however the user name on the Windows machine is also «username» and his name does appear in the samba password database then he is no longer a «Bad User» and he comes across as «username» and the situation is resolved. If this is the case then you could add yourself ( username ) to the samba password database:

Now the Windows user is also the Linux user and he has access to both shares without the need for «force user». But this will only work for the Windows user «username». You would still need the «force user» if you have many windows clients.

If however the client machine is running Linux the situation changes.

The Linux samba client doesn’t pass a user name when it tries to access the Mint machine because . well . Linux thinks that’s goofy. The Linux client will always come across as «nobody» unless the share requires credentials. In this scenario — for a guest share — «force user» is the easiest way to resolve the situation without changing the guest share to a private share requiring credentials.

Either way «force user» doesn’t give the remote user full access to your entire box only to the samba shares and only within the parameters set in the share definition for those shares.

Edited for spelling — I just can’t spell

Вручную примонтировать шару win 10

Здравствуйте не могу, по сети, примонтировать шару win10 (win 7,на другом комп-ре монтируется без ошибок), win 10 еще не включал smb 1.0(можно ли не включать) пробовал так:

Помнится там в user= нужно указывать . Попробуй для начала подключится к шаре через smbclient.

Win 7 видится, win 10 нет

1. Не //192.168.1.37/, а //192.168.1.37/sh

2. Каталог /home/user/shdsk/ существует?

3. Юзер first существует и на сервере, и на хосте?

4. В /etc/samba/smb.conf в секции [global]:

1. Пробовал и так, и эдак. 2. /home/user/shdsk существует, win7 туда монтировал и проверял, //192.168.1.37/sh существует с другой win10 доступно по паролю. 3. Пользователь одноименный с одинаковыми паролями на сервере и на хосте. 4. Этого не было, добавил, перезапустил службу smbd, статус зелененький. Но ни чего не изменилось.

Couldn’t chdir to uid=1006,: No such file or directory

Пробел между запятой и следующей опцией не нужен.

То есть не «username=first, uid=1006», а «username=first,uid=1006» и так везде

Оцените статью