Techno Blog Just another Technology Blog

2Apr/113

Mount Dropbox Account on Linux

This article outlines the process for associating your Dropbox with DropDAV and mounting this WebDAV as a filesystem on Linux.

  1. First, go to DropDAV and link to your Dropbox account. If your Dropbox account free, then your DropDAV account will be free. If your Dropbox account is paid, then your DropDAV account is 30% of your Dropbox plan price.

  2. In their infinite wisdom DropDAV decided to begin charging for even their low end accounts, so I would recommend using something else like Amazon s3 instead

  3. If you have not already done so, add Dag Wieers RPMforge repository.
  4. More information on how to do this can be found in this post.

  5. Install "fuse" and "davfs2"
  6. $ yum install fuse davfs2

  7. Make a directory to mount to use as a mount point
  8. $ mkdir -m 755 /mnt/dropbox

  9. Mount dropbox
  10. $ mount -t davfs https://dav.dropdav.com /mnt/dropbox
    Please enter the username to authenticate with server
    https://dav.dropdav.com or hit enter for none.
      Username: username@domain.com
    Please enter the password to authenticate user username@domain.com with server
    https://dav.dropdav.com or hit enter for none.
      Password:

    You might see a warning such as this. This tells me that there is no file locking mechanism with this WebDAV server so I will be careful not to make changes in two places at once. For instance in my dropbox client on windows and in my Linux mount. If you do not necessarily need this mount to be read/write I recommend mounting it as readonly.
    /sbin/mount.davfs: warning: the server does not support locks

  11. You can view this filesystem like any other mounted filesystem on your Linux machine
  12. $ df -h /mnt/dropbox
    Filesystem            Size  Used Avail Use% Mounted on
    https://dav.dropdav.com
                           26G   13G   13G  50% /mnt/dropbox

  13. Unmount the filesystem like any other when you are finished with it
  14. $ umount /mnt/dropbox
    /sbin/umount.davfs: waiting while mount.davfs (pid 10214) synchronizes the cache .. OK

  15. If you would like to be able to mount this as a normal user, then add the "davfs2" group to that user
  16. $ usermod -a -G davfs2 username

  17. Add an entry such as this to /etc/fstab
  18. https://dav.dropdav.com /mnt/dropbox            davfs   rw,noauto,users 0 0

  19. Any user who is a member of the "davfs2" group will be able to mount this without being root. They will obviously need the credentials of the dropbox account as well.
  20. $ mount /mnt/dropbox

  21. On my CentOS 5 system, I received the following error when attempting to mount this as a normal user
  22. $ mount /mnt/dropbox
    /sbin/mount.davfs: / is the home directory of user nobody.
    You can't mount into another users home directory
  23. This is because certain users, such as "nobody" are given "/" as their home directory. These are users for services and have no shell associated with their account anyway.
  24. To resolve this I simply identify the users
  25. $ awk -F: '($6 == "/") {print}' /etc/passwd
    nobody:x:99:99:Nobody:/:/sbin/nologin
    nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
    rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
    dbus:x:81:81:System message bus:/:/sbin/nologin
    avahi:x:70:70:Avahi daemon:/:/sbin/nologin
    haldaemon:x:68:68:HAL daemon:/:/sbin/nologin

  26. And change their home directory to /dev/null
  27. $ usermod -d /dev/null nobody
    $ usermod -d /dev/null nscd
    $ usermod -d /dev/null rpc
    $ usermod -d /dev/null dbus
    $ usermod -d /dev/null avahi
    $ usermod -d /dev/null haldaemon

    I just love sending things to /dev/null 🙂

Related Posts

Add Dag Wieers RPMforge Repository

Comments (3) Trackbacks (0)
  1. I suggest to change step 13/14 to something like
    echo “ignore_home$(awk -F: ‘($6 == “/”) {printf ” ” $1}’ /etc/passwd)” | sudo tee -a /etc/davfs2/davfs2.conf

  2. correting myself, my complete script
    users=$(awk -F: -v ORS=”,” ‘($6 == “/”) {print $1}’ /etc/passwd)
    echo “ignore_home ${users%”,”}” | sudo tee -a /etc/davfs2/davfs2.conf

  3. thanks.
    I’m doing that for box
    + boxfs -f boxfs.cfg


Cancel reply

No trackbacks yet.