First off let me say that this is a repost of a question I posted in AskUbuntu. If this is against the rules then please remove this. Honestly, after further consideration of the topic I realized that since autofs works basically the same across various distros, that this was more of an autofs/linux question than an Ubuntu-specific question. Of course, this is my justification because I'm also hoping to get more exposure for this question: it seems like autofs and WebDAV is a rather uncommon combination, so I have more of a chance of finding someone else who has done it successfully if I try in this more general forum.
I am using placeholders for real server names and folders, however, I have tried to make them as representative of the real names as possible, so please do pay attention to my capitalization and punctuation just in case that has anything to do with my problem.
I'm running Ubuntu 16.04.
I've installed autofs and davfs2.
The following command successfully mounts:
mount -t davfs https://servername.mydomain.com:3333/Shared.Folder /testmount
It asks me for a username and password, which are username@mydomain.com
and myypassword
and then results in a succesful mount.
This tells me several things:
- My WebDAV server is working and configured correctly.
- HTTPS works fine.
- My credentials authenticate succesfully.
So now I'm trying to get this working with autofs.
Here are my files:
/etc/auto.master
/Server.mount /etc/auto.Servername.mount
/etc/auto.Servername.mount
storage-folder -fstype=davfs,ro :https://servername.mydomain.com:3333/Shared.Folder
/etc/davfs2/secrets
https://servername.mydomain.com:3333/Shared.Folder username@domain.com mypassword
With this setup, if I try to browse to /Servername.mount/storage-folder
, I get a No such file or directory error
.
Now I'm like 95% sure that my problem is a syntax error or an authentication error. There are not a lot of examples to be found on the web for WebDAV-based implementations of autofs, and some of them show conflicting syntax. Nevertheless, I've tried everything I could think of.
I think it is likely that the colon in the auto.Servername.mount
file is screwing up the parsing, so I've tried all the following combinations:
storage-folder -fstype=davfs,ro https://servername.mydomain.com:3333/Shared.Folder
storage-folder -fstype=davfs,ro https\://servername.mydomain.com\:3333/Shared.Folder
storage-folder -fstype=davfs,ro :https\://servername.mydomain.com\:3333/Shared.Folder
storage-folder -fstype=davfs,ro https\://servername.mydomain.com\:3333:/Shared.Folder
If that is not causing the problem, then I think it might be something to do with the secrets
file. So I've also tried this for my secrets
:
/Servername.mount/storage-folder username@domain.com mypassword
Since I'm used to using a credentials file with cifs-based autofs mounts, I also tried, just for fun, in my auto.Servername.mount
file:
storage-folder -fstype=davfs,ro,credentials=/etc/credentials.Servername.mount https://servername.mydomain.com:3333/Shared.Folder
Where credentials.Servername.mount
was simply:
Username=username@mydomain.com
Password=mypassword
I also tried with 'credentials.Servername.mount` as:
https://servername.mydomain.com:3333/Shared.Folder username@domain.com mypassword
Nothing works.
So I feel like I'm missing some small but crucial piece of syntax or config here. I come to you desperate. Any help would be appreciated!