Failed to mount (inactive): mount error(13) when mounting CIFS from Synology
-
Hi there,
When I try mouting a CIFS (Samba) share from my Synology Diskstation NAS, I get the following error:
Failed to mount (inactive): mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
My logs tell me that no dialect is specified and that I should manually specify it. However, this is all via GUI and I wanted to avoid messing with command line stuff to keep things simple. What should I do to resolve this? :s
[173190.444124] CIFS: Attempting to mount //192.168.2.199/piwigo [173190.444141] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount. [173190.533535] Status code returned 0xc000006d STATUS_LOGON_FAILURE [173190.533543] CIFS VFS: \\192.168.2.199 Send error in SessSetup = -13 [173190.533614] CIFS VFS: cifs_mount failed w/return code = -13
-
The mount file is generated with the options mentioned at https://git.cloudron.io/cloudron/box/-/blob/master/src/mounts.js#L93
Can you maybe try to adjust this (after editing that file, which is at
/home/yellowtent/box/src/...
, runsystemctrl restart box
) with options recommended by your Synology? -
@3246 Can you tell us what special characters it has? Does it have a comma or double/single quote ? From what I read from the man pages:
https://manpages.debian.org/testing/systemd/systemd.mount.5.en.html says
Mount options to use when mounting. This takes a comma-separated list of options. This setting is optional. Note that the usual specifier expansion is applied to this setting, literal percent characters should hence be written as "%%".
. https://www.man7.org/linux/man-pages/man5/systemd-system.conf.5.html has the specifier table. It has no special meaning for double quotes AFAICT.https://linux.die.net/man/8/mount.cifs says
Note that a password which contains the delimiter character (i.e. a comma ',') will fail to be parsed correctly on the command line. However, the same password defined in the PASSWD environment variable or via a credentials file (see below) or entered at the password prompt will be read correctly.
. So, maybe we have to create a credentials file for this to be reliable. -
@3246 ok, https://www.freedesktop.org/software/systemd/man/systemd.syntax.html has some more.
Can you please try
systemd-escape <your-password>
and use that instead of quoting in the mount file? If that works, I can fix up our code accordingly. -
@girish @nebulon thanks both. The previous password contained: @ & ^
It works OK on the command line, where I can escape it using double quotes or just pasting it in the prompt when running interactively.
I will have a go with a test user and suitably complex password and report back, after trying the 'system-escape' option.
-
@girish said in Failed to mount (inactive): mount error(13) when mounting CIFS from Synology:
@3246 ok, https://www.freedesktop.org/software/systemd/man/systemd.syntax.html has some more.
Can you please try
systemd-escape <your-password>
and use that instead of quoting in the mount file? If that works, I can fix up our code accordingly.Sadly, this did not work. I also tried MD5 hashing but the only reliable way is to use a password without special characters so far
-
@3246 thanks for trying! If you don't mind trying one more approach:
- Create a credentials file like:
username=username password=password
- Then in the systemd mount file, do
Options=credentials=/path/to/credentialsfile,..other options...
See articles like https://askubuntu.com/questions/1119819/how-do-i-use-a-credential-file-for-cifs-in-etc-fstab
I think we should do one of these:
-
When complex passwords are entered in UI, we can inform the user about this limitation, so they don't end up with your situation.
-
If credential file works, we will fix the code to use that approach.
-
@girish OK, slowly for those of us who don't read too well ;D
Do you mean /etc/fstab or some other way to put the options line in? I am familiar with the former but even after DuckDuckGoing for 2min not that much more clued in about the latter.
What do I do in the GUI?
-
-
I have tried to fix this with https://git.cloudron.io/cloudron/box/-/commit/dbb803ff5e3e837a7c8f49c4890bccc5329946d5 . Let's see if the situation is better in the next release.
-
-
I have a similar issue when connecting to a Hetzner StorageBox system:
Failed to mount (inactive): mount error(128): Key has been revoked Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
My settings are the following:
Any tips on how to get this fixed? The git commit is some months old so I thought this might be already included in the latest Cloudron release?
Best
Jay -
@jayonrails said in Failed to mount (inactive): mount error(13) when mounting CIFS from Synology:
Key has been revoked
I think the error is coming from Hetzner . Did you possible revoke your existing key? Maybe you can generate new keys and try?
-
@girish does key mean the password I received for the login? Or does it mean the authentication with an SSH Private / public key pair?
This would also be possible on Hetzner Storage Box, but is not what I have configured. I am curious because in my understanding a password cannot be revoked, while a private key could be revoked, but is nothing I am using right now.
I will check the credentials again and will let you know the results.
Best
Jay -
@jayonrails SSH and SAMBA access havenβt been enabled yet, therefore it didnβt worked. After enabling it, everything works perfectly.