http://www.linux-tips-and-tricks.de

Wie kann man Medienspeicher oder SmartDrive unter Linux einbinden/How to use webdav on Linux PDF Print E-mail
Montag, 03 Oktober 2011
Seit ein paar Tagen besitze ich 25GB Speicherplatz von der t-com. Diese bietet es in ihrem Mediacenter kostenlos für t-com bzw telekom Kunden an. Da ich als Linuxer gewohnt bin meinen Speicherplatz zu mounten und nicht per WebFrontend zu administrieren habe ich mich mal umgesehen wie ich das unter OpenSuSE 11.4 sowie Mint hinbekomme. Unter einer anderen Distribution funktioniert es sicherlich auch. Die Konfiguration wird ausser der Art, wie das Paket installiert wird, identisch sein.
 
Update 14.3.2012:
Mittlerweile bin ich Kunde von 1&1. Die bieten u.A. 15 GB Speicherplatz an (1&1 SmartDrive) . Die Einbindung als webdav funktioniert genauso schnell wie für die t-com- nur muss die url entsprechend angepasst werden. Das 1&1 Smartdrive - Pendent zum Mediencenter bei t-com - ist wesentlich besser. Bei der t-com kann man keine Daten in die Ordner kopieren, die man für andere Personen freigegeben hat (Share), da diese nicht im webdav sichtbar sind. Damit kann man das Mediencenter mit webdav vergessen wenn man Daten mit anderen Leuten sharen will. Als Backupmedium ist es aber gut zu benutzen. Dieses Problem hat man bei 1&1 nicht.
 
Es gibt verschiedene Arten dern webdav Space einzubinden.
 
1)  wdfs - Sehr einfach zu benutzen. Nur ein Befehlszeilenaufruf notwendig und man kann per Konsole oder Dateimanager auf den Space zugreifen.
2) davfs - Ist erst einmal zu konfigurieren. Danach funktioniert es genauso wie wdfs. Bindet den Space genauso wie alle anderen Laufwerke (Platten, nfs, smbfs) in Linux als Filesystem ein und ist der Standard Linux Weg Space für Linux verfügbar zu machen.Meine Empfehlung.
3) cadaver - Funktioniert ähnlich wie ein ftp oder smb client aus der Befehlszeile
 
Verschiedene Filemanager wie Dolphin oder krusader bieten auch die Möglichkeit per dav auf Plattenspace zuzugreifen. Wer wdfs oder davfs benutzt kann mit diesen Filemanagern auch transparent auf die Daten über den Mountpoint zugreifen und mit ihnen arbeiten.
 
Ich persönlich benutze davfs weil es das webdav Laufwerk genauso einbindet wie es für alle  anderen Laufwerke in Linux gemacht wird und man dann sowohl per Befehlszeile als auch mit einem Dateimanager wie dolphin oder krusader  drauf zugreifen kann.
 
In einem weiteren Artikeln habe ich beschrieben was man machen muss um webdav in den totalcommander einzubinden .
 
===> English <===
 
If you want to use webdav space with Linux there exist various ways to connect this space to a Linux system. I got 25 GB webdav space for free from a German provider and found out how to connect this space to my OpenSuSE 11.4 and Mint systems. It will definitely work also also on other distributions. The way to install the package will be different.
 
There exist various ways to use webdav space on LInux:
 
1)  wdfs - Very easy to use. It's a simple command line and then you can access the webdav space from a console or any filemanager.
2) davfs - You have to configure this first. Then you can use it the same way as wdfs. The way it's used by Linux is identical to the other spaces like disks, nfs, smbfs which are used as filesystems in Linux. davfs is my suggested way to use webdav in Linux.
3) cadaver - Works similar like a ftp or smb client on the command line
 
There exist variouse filemanagers like dolphin and krusader which offer their own way to connect to a webdav space. If you use wdfs or davfs you can easily use these filemanagers to work with webdav space transparently by a mount point.
 
I personaly use davfs because the webdav space is used the same way in Linux like all other space is managed. I can use my dolphin or krusader easily to access the webdav space.
 
There is another article which describes how to use webdav with totalcommander.
 
 
 
wdfs
 
Ist sehr schnell benutzbar. Wichtig ist, dass man die richtigen Benutzerdaten (speziell das richtige Passwort) eingibt, denn dummerweise bekommt man keine Fehlermeldung wenn das Passwort nicht stimmt sonder alles läuft sehr langsam und letztendlich hat man doch keinen Zugriff auf die Daten.Der folgende Befehl mountet den t-com mediacenter webdav Speicherplatz. Dabei ist /home/framp/webdav das Verzeichnis, wo der Speicherplatz gemountet wird und xxxxx die eigene t-com bzw 1&1 Userid sowie yyyyyy das Passwort.
 
wdfs https://webdav.mediencenter.t-online.de /home/framp/webdav/ -o username= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it -o password=yyyyyy  -o accept_sslcert
bzw für 1&1
wdfs https://sd2dav.1und1.de  /home/framp/webdav/ -o username= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it -o password=yyyyyy  -o accept_sslcert 
 

 
davfs 
 
Leider ist es mit wdfs nicht so ganz die Art wie man unter Linux standardmäßig Speicherplatz mountet. Deshalb gibt es das davfs2 Paket. Diese muss man für OpenSuSE hier runterladen und installieren. Bei Mint ist es im Softwaremanager standarmäßig verfügbar und kann dort installiert werden. Danach muss das Mountverzeichnis erstellt werden
 
mkdir /media/webdav
 
und ist die folgende Zeile in der /etc/fstab erforderlich:
 
https://webdav.mediencenter.t-online.de        /media/webdav   davfs   rw,noauto,user  0       0 
bzw für 1&1
https://sd2dav.1und1.de          /media/webdav   davfs   rw,noauto,user  0       0 
 
und da davfs das Programm zum Mounten in /usr/sbin/mount.davfs ablegt und 'mount' ihn in /sbin erwartet muss man den folgenden Link einrichten:
 
ln -s /usr/sbin/mount.davfs /sbin/mount.davfs
Update 22.3.2012: tomm.fa hat im Kommentar zu dieser Seite darauf hingewiesen , dass bei Verwendung von davfs die Verknüpfung (ln -s /usr/sbin/mount.davfs /sbin/mount.davfs) unter openSUSE 12.1 nicht (mehr) notwendig ist.
 
Durch einen Fehler in der webdav Implementierung bei t-online können keine Dateien angelegt werden. Es kommt immer die Meldung dass die Datei existiert - obwohl sie es nicht tut. Deshalb muss in der /etc/davfs2/davfs2.conf die folgende Zeile eingefügt werden um die locks auszuschalten.
 
use_locks       0
 
Wenn man den Speicherplatz automatisch beim Booten des Systems mounten möchte muss man noch das noauto in der /etc/fstab entfernen. Allerdings wird man i.d.R. den Speicherplatz nur mounten wenn man ihn benötigt und dieses als normaler Benutzer - nicht als root. Deshalb muss man noch folgende Dinge konfigurieren:
 
1) Damit normale User mount aufrufen können muss das suid bit gesetzt werden
 
chmod u+s /usr/sbin/mount.davfs
 
2) Der Benutzer bbbbb welcher das webdav Laufwerk mounten können soll muss in die Gruppe davfs2 aufgenommen werden 
 
usermod -G davfs2 bbbbb
 
3) Normalerweise muss der Benutzer immer die Zugangsdaten beim Mounten manuell eingeben
 
framp@obelix:~/.davfs2> mount /media/webdav/
Please enter the username to authenticate with server
https://webdav.mediencenter.t-online.de/ or hit enter for none.
  Username: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Please enter the password to authenticate user This e-mail address is being protected from spam bots, you need JavaScript enabled to view it with server
https://webdav.mediencenter.t-online.de/ or hit enter for none.
  Password: 
bzw für 1&1
framp@obelix:~/.davfs2> mount /media/webdav/
Please enter the username to authenticate with server
https://sd2dav.1und1.de/  or hit enter for none.
  Username: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Please enter the password to authenticate user This e-mail address is being protected from spam bots, you need JavaScript enabled to view it with server
https://sd2dav.1und1.de/  or hit enter for none.
  Password: 
 
Diese Daten kann man in ein davfs Profile ablegen. Z.B. in ~/.davfs2/secrets den folgenden Inhalt ablegen:
 
https://webdav.mediencenter.t-online.de/    This e-mail address is being protected from spam bots, you need JavaScript enabled to view it     yyyyy 
bzw für 1&1
https://sd2dav.1und1.de/    This e-mail address is being protected from spam bots, you need JavaScript enabled to view it     yyyyy  
 
wobei xxxxx die eigene t-com bzw 1&1 Userid sowie yyyyyy das Passwort ist. Die Datei muss die Rechte 600 bekommen. Natürlich kann man die Daten auch für das System global ablegen so dass jeder Benutzer den Speicherplatz ohne Passwort mounten kann. Details stehen dazu in den man Page zu davfs  
 

 
cadaver
 
cadaver erlaubt es wie per ftpclient oder dem smbclient auf den webdav Speicher zuzugreifen.  Allerdings geht es dann nicht mit einem normalen Filemanager sonder nur aus der Befehlszeile. Nachdem man cadaver installiert hat sind zwei Dinge noch zu konfigurieren:
 
1) ~/.netrc wobei xxxxx der t-com bzw 1&1 Benutzer ist und yyyyy dass Passwort
 
machine webdav.mediencenter.t-online.de
login This e-mail address is being protected from spam bots, you need JavaScript enabled to view it                                                                                      
password yyyyy
 
bzw für 1&1 
 
machine sd2dav.1und1.de
login This e-mail address is being protected from spam bots, you need JavaScript enabled to view it                                                                                      
password yyyyy
 
2) .cadaverrc
 
open https://webdav.mediencenter.t-online.de
bzw für 1&1
open https://sd2dav.1und1.de 
 
Das folgenden kurze Beispiel zeigt wie man Dateien hochladen bzw runterladen kann und sich den Inhalt ansehen kann:
 
framp@obelix:/framp> cadaver
dav:/> put netload
Uploading netload to `/netload':
Progress: [=============================>] 100.0% of 1197 bytes succeeded.
dav:/> get netload
Enter local filename for `/netload': netload
Downloading `/netload' to netload:
Progress: [=============================>] 100.0% of 1197 bytes succeeded.
dav:/> ls
Listing collection `/': succeeded.
        netload                             1197  Oct  8 18:22
dav:/>
dav:/> quit 
 

 
Filemanager
 
Es gibt diverse Filemanager wie Dolphin oder Krusader die eigene eingebaute Möglichkeiten bieten auf webdav Daten zuzugreifen. Ich kann nur jedem empfehlen diese Funktionen nicht zu benutzen sondern immer den LinuxStandard um auf Filesysteme (webdav ist auch eine Filesystem für Linux über davfs) über einen Mountpoint zuzugreifen.



Alternative webdav Zugriffsmethoden unter Linux
 
Die folgenden Dateimanager erlauben es auch direkt in ihnen Verbindungen zu webdav Space einzurichten. Ich finde es ehrlich gesagt wesentlich transparenter den Space vorher vom System oder Benutzer zu mounten und dann mit den Dateimanagern auf den webdav Space zuzugreifen. 
 
krusader - Einfach webdavfs://webdav.mediencenter.t-online.de eingeben, dann dieBenutzerid und das Kennwort


 
Hilfreiche Links
 
dafvs - Bräuchte Hilfe - Gentoo Forum
telecom cloud - linux-club Forum
 

 
Fehler und Fehlermeldungen
 
Im Fehlerfalle oder bei Fehlfunktionen ist es hilfreich in der /etc/davfs2/davfs2.conf den debug modus einzuschalten und im /var/log/messages die Meldungen/Fehlermeldungen zu verfolgen.
 
mount -t davfs https://webdav.mediencenter.t-online.de/ -o username= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it password=yyyyy
mount: unknown filesystem type 'davfs' 
=> Link  einrichten (s.o.)
 
/sbin/mount.davfs: program is not setuid root: No such file or directory
=> Das setuid Bit muss gesetzt werden (s.o.)
 
cp: cannot create regular file `photo.jpg': File exists
==> Die Datei /etc/davfs2/davfs2.conf  wurde nicht geändert dass keine locks erstellt werden (s.o.)
 

 
===> English <===
 
wdfs
 
That's the fastest way to use webdav. It's important to enter the right credentials because you unfortunately don't get any error message if the password is invalid. Following command mounts the  t-com mediacenter webdav space. /home/framp/webdav is the local directory where the space is mounted and xxxxx  the t-com userid and yyyyyy is the password.
 
wdfs https://webdav.mediencenter.t-online.de /home/framp/webdav/ -o username= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it -o password=yyyyyy  -o accept_sslcert
   

 
davfs 
 
Unfortunately wdfs is not the common way to mount space in Linux. There exist the davfs2 package for this. For OpenSuSE use this this link for download and installation. For Mint use the softwaremanager because davfs is included in the distribution. Afterwards you have to create the mount directory for webdav
 
mkdir /media/webdav
 
and add following line in  /etc/fstab
 
https://webdav.mediencenter.t-online.de        /media/webdav   davfs   rw,noauto,user  0       0 
 
Because the davfs mount command is located in /usr/sbin/mount.davfs and 'mount' expects the command in /sbin you have to create a link 
 
ln -s /usr/sbin/mount.davfs /sbin/mount.davfs
Update 22.3.2012: tomm.fa pointed out in his comment to this page: If dafvs is used (ln -s /usr/sbin/mount.davfs /sbin/mount.davfs) is not needed any more on openSUSE 12..
 
A bug in the webdav implementation of t-online doesn't allow to create files - just to read them. You get a message the file exists - even if it doesn't exist. Therefor you have to  enter in /etc/davfs2b the following line to disable the file locks
 
use_locks       0
 
If you want to mount the webdav space during boot of the system you have to remove the noauto flag in /etc/fstab. In general you will mount the space only if you need it as a normal user - not root. Therefore you have to conffigure 
 
1) To enable mount for a normal user set the suid bit
 
chmod u+s /usr/sbin/mount.davfs
 
2) The user bbbbb who should mount the webdav disk has to be in the group davfs2 
 
usermod -G davfs2 bbbbb
 
3) Every time you mount the webdav space you will be prompted for the crendentials.
 
framp@obelix:~/.davfs2> mount /media/webdav/
Please enter the username to authenticate with server
https://webdav.mediencenter.t-online.de/ or hit enter for none.
  Username: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Please enter the password to authenticate user This e-mail address is being protected from spam bots, you need JavaScript enabled to view it with server
https://webdav.mediencenter.t-online.de/ or hit enter for none.
  Password: 
 
You can place these credentials in a davfs profile. For example enter on user base in ~/.davfs2/secrets the following line
 
https://webdav.mediencenter.t-online.de/    This e-mail address is being protected from spam bots, you need JavaScript enabled to view it     yyyyy 
 
where xxxxx is the t-com userid and yyyyyy is the password. You also can configure these credentials globaly for the system so that every user can mount the space without any credential prompt. See man Page for davfs  for details
 

 
cadaver
 
cadaver allows similar to ftpclient or smbclient to access the webdav space.  There is no way to access the space with a filemanager with cadaver. Two config steps are required:
 
1) ~/.netrc where xxxxx is the t-com user and yyyyyis the password
 
machine webdav.mediencenter.t-online.de
login This e-mail address is being protected from spam bots, you need JavaScript enabled to view it                                                                                      
password yyyyy
 
 2) .cadaverrc
 
open https://webdav.mediencenter.t-online.de
 
See following example how to up- and download files with cadaver
 
framp@obelix:/framp> cadaver
dav:/> put netload
Uploading netload to `/netload':
Progress: [=============================>] 100.0% of 1197 bytes succeeded.
dav:/> get netload
Enter local filename for `/netload': netload
Downloading `/netload' to netload:
Progress: [=============================>] 100.0% of 1197 bytes succeeded.
dav:/> ls
Listing collection `/': succeeded.
        netload                             1197  Oct  8 18:22
dav:/>
dav:/> quit 
 

 
Filemanager
 
There exist various filemanager like Dolphin or Krusader which have their own way to access webdav space. I suggest not to use this feature but use davfs instead to access the space via a mount point.
 
krusader Just enter webdavfs://webdav.mediencenter.t-online.de, then userid and password
 

 
Links
 
dafvs - Bräuchte Hilfe - Gentoo Forum- German
telecom cloud - linux-club Forum- German
cadaver - English
 

 
Error messages
 
In case of errors it's helpful to turn on the debug mode in  /etc/davfs2/davfs2.conf and to check for error messages ins /var/log/messages.
 
mount -t davfs https://webdav.mediencenter.t-online.de/ -o username= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it password=yyyyy
mount: unknown filesystem type 'davfs' 
=> Create link 
 
/sbin/mount.davfs: program is not setuid root: No such file or directory
=> Set setuid bit 
 
cp: cannot create regular file `photo.jpg': File exists
==> File /etc/davfs2/davfs2.conf  was not changed so that locks are disabled
 
 
Last Updated ( Donnerstag, 17 Mai 2012 )
 

Add comment

===> Pls add comments in German or English only <===
eMail will be hidden/eMail wird versteckt


Security code
Refresh

< Prev   Next >