8

I'm trying to make a WebDAV auto-mount on my machine.

I've installed davfs2, then copied /etc/davfs2 to ~/.davfs2. I added the WebDAV URL to /etc/fstab:

[URL of the WebDAV]   [Local folder]    davfs   rw,user,auto    0   0

I also added the username and password to ~/.davfs2/secrets and uncommented secrets ~/.davfs2/secrets in ~/.davfs2/davfs2.conf to enable automatic login.

Now I can manually mount it by running mount www.myserver.com (it doesn't ask me for username/password). I understand that running mount -a will do the same thing that would've been done at boot, but when I run sudo mount -a as my user (just mount -a says I need to be root) I do get asked for a username/password.

I then uncommented secrets ~/.davfs2/secrets in /etc/davfs2/davfs2.conf to enable automatic authentication (see this and this). Now running sudo mount -a AND just using mount both result in /sbin/mount.davfs:/etc/davfs2/davfs2.conf:36: unknown option. Line 36 is the secrets ~/.davfs2/secrets line.

Why does it say unknown option? How do I fix it?

  • One problem I had: When using the conf= option for mount -o the davfs.conf file needs to be given as parameter (with an absolute path to the secrets file!), not the secrets file itself. – sebix Aug 18 at 7:41
6

I have just sorted this out on a linux (mint 17.3) laptop.

There were two things contributing to my problem:

  1. I had enabled ordinary users to use davfs. Leave the secrets line in /etc/davfs2/davfs2.conf commented out. This will force davfs to rely on the user specific configuration. I had both the global (/etc/davfs2/) and user (~/.davfs2/) configuration files both trying to do the job at the same time.

    1(a). you may need to uncomment the secrets line in ~/.davfs2/davfs2.conf. Mine is uncommented and works, but the default may work fine too. I have not tested it.

  2. in ~/davfs2/cache/ the directory for my remote webdav connection cache had incorrect permissions - it needs to be set to 0700 (not just 700).

  • 5
    The 'secrets' line is not allowed in /etc/davfs2/davfs2.conf, and this is why the error "unknown option" is thrown. The 'secrets' line is allowed in user config files like ~/.davfs2/davfs2.conf. Just copy the stock /etc/davfs2/davfs2.conf file to ~/.davfs2/ and uncomment the secrets line in ~/.davfs2/davfs2.conf . – Donn Lee Oct 4 '16 at 6:28
3

I had the same problem when I named the file ~/.davfs2/secret instead of ~/.davfs2/secrets. I fixed this and now it works.

It seems that the error message is misleading, there's nothing wrong with the option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.