Box.com is one of many online services that offer secure file sharing & cloud storage. A cool feature of box.com is that it can be easily mounted to a Linux system. Reasons you might want to mount box.com to your local filesystem could include:

  • Creating automated cloud backups (as easy as rsync'ing or cp'ing files to the mount directory)
  • Improving the ease of modifying cloud-based files
  • Making it easier to share many files with a friend

Mount Box.com Account Link to heading

  • Install davfs2 with dnf (replace dnf with yum on CentOS)
[stuart@asuka ~]$ sudo dnf install davfs
  • Create the directory that you will mount box.com to
[stuart@asuka ~]$ sudo mkdir /box.com

- Open /etc/fstab in your favourite editor and add the following line

https://www.box.com/dav    /box.com    davfs    rw,user,noauto    0 0

- Create configuration files for the mount

[stuart@asuka ~]$ mkdir ~/.davfs2
[stuart@asuka ~]$ cp /etc/davfs2/davfs2.conf ~/.davfs2/
[stuart@asuka ~]$ cp /etc/davfs2/secrets ~/.davfs2/
  • Ensure correct permissions are applied to the secrets file
[stuart@asuka ~]$ chown stuart ~/.davfs2/secrets
[stuart@asuka ~]$ chmod 600 ~/.davfs2/secrets
  • Open ~/.davfs2/davfs2.conf in your favourite editor and make the following changes

Uncomment the line:  # secrets    ~/.davfs2/secrets At the bottom of the file add:  use_locks    1

  • Open ~/.davfs2/secrets in your favourite editor and add the following line to the bottom of the file
https://www.box.com/dav    **box.com-username**    **box.com-password**
  • Add the user to the group davfs2
[stuart@asuka ~]$ sudo usermod -aG davfs stuart
  • Mount the box.com account (do this as the user the secrets file has been setup for)
[stuart@asuka ~]$ mount /box.com/