2010-08-14 23:30:31 +02:00
|
|
|
HOW TO CONNECT WITH A WEBDAV SERVER WITH THE DAVF2 APPLICATION
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
In this HOWTO, the user is named "user"
|
|
|
|
Amend as required for your choice of username.
|
|
|
|
|
|
|
|
1. Login as root
|
|
|
|
|
|
|
|
2. Define a davfs2 group and user:
|
|
|
|
|
|
|
|
# groupadd -g 230 davfs2
|
2012-12-03 01:55:46 +01:00
|
|
|
# useradd -u 230 -d /var/cache/davfs2 -g davfs2 -s /bin/false davfs2
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
3. Build and install davfs2 as usual.
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
4. Add the user if not already defined. My user shall be called chris, so:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
# adduser chris
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
Read the Slackbook for more details on adduser, choose default settings BUT:
|
|
|
|
with the default group list add also davfs2:
|
|
|
|
|
|
|
|
Press ENTER to continue without adding any additional groups
|
|
|
|
Or press the UP arrow to add/select/edit additional groups
|
2012-12-03 01:55:46 +01:00
|
|
|
: audio cdrom floppy plugdev video power netdev lp scanner davfs2
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2010-08-14 23:30:31 +02:00
|
|
|
If the user was already defined, then add davfs2 to the groups:
|
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
# usermod -aG davfs2 chris
|
2010-08-14 23:30:31 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
5. Edit /etc/fstab with the following line:
|
2010-05-13 01:00:45 +02:00
|
|
|
WEBDAV_SERVER_URL mount_point davfs noauto,user 0 0
|
|
|
|
|
|
|
|
For example:
|
2012-12-03 01:55:46 +01:00
|
|
|
https://example.org/chris /home/chris/mnt/dav davfs noauto,user 0 0
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
6. logout
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
7. Login again as your davfs user ("chris" in my case).
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
8. $ mkdir -p $HOME/.davfs2/certs/private/ $HOME/mnt/dav
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
9. Move the certificate to $HOME/davfs2/certs/private and restrict the permission to rw-------:
|
|
|
|
For example:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
$ mv CERTIFICATE.pfx $HOME/.davfs2/certs/private/
|
2012-12-03 01:55:46 +01:00
|
|
|
$ chmod 600 $HOME/.davfs2/certs/private/CERIFICATE.PFX
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
10. Optionally: Copy the system configuration file. There are a lot of
|
|
|
|
interesting comments in these files that might be helpful.
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
$ cp /usr/share/davfs2/* $HOME/.davfs2/
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
11. Edit $HOME/.davfs2/davfs2.conf with the following line:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
clientcert ~/.davfs2/certs/private/CERTIFICATE.PFX
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
Read:
|
|
|
|
|
|
|
|
$ man davfs2.conf
|
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
for all the details and options. Tests have shown that you might need more
|
|
|
|
than the line above, so you may want to read about other interesting
|
|
|
|
parameters, e.g.:
|
|
|
|
|
|
|
|
add_header Translate F
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
12. Edit $HOME/.davfs2/secrets with the following 2 lines:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
/home/chris/mnt/dav username password
|
|
|
|
CERTIFICATE.PFX passphrase
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2010-08-14 23:30:31 +02:00
|
|
|
The username and password are relevant to the Webdav server, not for the
|
|
|
|
local account.
|
2010-05-13 01:00:45 +02:00
|
|
|
passphrase is the password for the PFX certificate
|
2010-08-14 23:30:31 +02:00
|
|
|
You should obtain all these from the Webdav server Administrator
|
2010-05-13 01:00:45 +02:00
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
13. Restrict permssion for $HOME/.davfs2/secrets to rw-------:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
$ chmod 600 $HOME/.davfs2/secrets
|
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
14. Mount the davfs service on $HOME/mnt/dav
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
$ mount https://example.org/user
|
|
|
|
|
|
|
|
You should be able to see your WEBDAV server on $HOME/mnt/user
|
|
|
|
|
2012-12-03 01:55:46 +01:00
|
|
|
15. When you would like to disconnect:
|
2010-05-13 01:00:45 +02:00
|
|
|
|
|
|
|
$ umount $HOME/mnt/dav
|
|
|
|
|
|
|
|
You should get a similar response (the pid number is random):
|
|
|
|
|
|
|
|
/sbin/umount.davfs: waiting while mount.davfs (pid 5700) synchronizes the cache .. OK
|