Announcement

Collapse
No announcement yet.

Mounting Box account using webdav service

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mounting Box account using webdav service

    I dropped Dropbox (no pun intended) since they pulled much of their file system support, so I have started using my Box account more and more. There's no Linux sync client for Box but using webdav is an option if you want to be able to access your Box account without a browser. Most of the How-To's I saw on the were wrong or out-of-date so here's what worked for me using KDEneon 18.04. All these commands are done in konsole.

    Install davfs2;
    sudo apt install davfs2

    Add your user to the davfs2 group;
    sudo adduser <username> davfs2

    Make a hidden folder in your home to hold a config and password file;
    mkdir ~/.davfs2

    Copy the default config file and make some edits to it;
    cp /etc/davfs2/davfs2.conf ~/.davfs2
    sed -i '/# secrets/c\secrets ~/.davfs2/secrets' ~/.davfs2/test.conf
    sed -i '/# use locks 1/c\use locks 0' ~/.davfs2/test.conf


    Make a file named "secrets" and put your Box username and password into it;
    echo https://dav.box.com/dav <your box login> "<your password>" > ~/.davfs2/secrets

    Lock the secrets file down so only you can access it;
    chmod 600 ~/.davfs2/secrets

    Set mount.davfs2 so you can use it as a user rather than root;
    sudo chmod +s /usr/sbin/mount.davfs2

    And the last step is to add it to fstab so you can mount it with a simple command;
    https://dav.box.com/dav /home/<username>/Box davfs rw,user,noauto 0 0

    Don't forget you need to log out and back in to allow the group change to take effect. Once this is done, you should be able to enter this into konsole or krunner to mount your Box drive;
    mount ~/Box

    You can run this command when needed or put it in a script for automatic mounting at log in.

    Most of the web How-To's incorrectly show using "https://www.box.com..." rather than "https://dav.box.com..." and others left of the chmod +s... command.

    If you try this, let me know if it works or not so I can fix the How-To if needed, thanks.

    Please Read Me
Working...
X