Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

There is no official linux client for box.com. Also, the webdav service will be deprecated Jan 31, 2019, so that's not a viable solution. And the official list of protocols to upload and download files says FTPS (FTP over SSL/TLS) is an option, but the details of that specify no support for SSO users, which means human user accounts cannot use that method (it is not clear right now, if service accounts can use FTPS). So the options for linux client usage are very limited.

If FTPS can be used, there is a linux client called lftp for that.

The Box API (https://developer.box.com/docs) is expected to continue working. It seems crazy they didn't mention this on the official list above.

In linux there is a client called rclone. This is confirmed functional for now, and I got confirmation from the developer, that it uses the API so he believes it should remain functional.

How to use rclone:

  • First, you'll need to generate an OAuth token from your local laptop, as follows:
    • On your laptop (mac)
      • If you don't already have homebrew installed, install it from https://brew.sh/. Then run the "brew install" command:

         

        brew install rclone
      • In a Terminal window:

        • Type this:

          rclone authorize box
        • A web browser will open. Click on "Use Single Sign On (SSO)" and enter your Tufts email address.
        • Click "Grant access to Box"
        • When you're done, go back to your Terminal window. There is a special code displayed that you need to copy for use in the remote setup section, later in this procedure. 

  • Second, to configure a headless linux machine to use this account:

    • Ssh login to some linux machine.

    • Via puppet, or yum, install the rclone package.
    • Run the command:

      rclone config
    • Results:
      No remotes found - make a new one
      n) New remote
      s) Set configuration password
      q) Quit config
      n/s/q>

       

      n
       


      name>

       

      box
       


      Type of storage to configure.
      Choose a number from below, or type in your own value

      1 / Alias for a existing remote
      \ "alias"
      2 / Amazon Drive
      \ "amazon cloud drive"
      3 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
      \ "s3"
      4 / Backblaze B2
      \ "b2"
      5 / Box
      \ "box"
      6 / Cache a remote
      \ "cache"
      7 / Dropbox
      \ "dropbox"
      8 / Encrypt/Decrypt a remote
      \ "crypt"
      9 / FTP Connection
      \ "ftp"
      10 / Google Cloud Storage (this is not Google Drive)
      \ "google cloud storage"
      11 / Google Drive
      \ "drive"
      12 / Hubic
      \ "hubic"
      13 / Local Disk
      \ "local"
      14 / Mega
      \ "mega"
      15 / Microsoft Azure Blob Storage
      \ "azureblob"
      16 / Microsoft OneDrive
      \ "onedrive"
      17 / OpenDrive
      \ "opendrive"
      18 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
      \ "swift"
      19 / Pcloud
      \ "pcloud"
      20 / QingCloud Object Storage
      \ "qingstor"
      21 / SSH/SFTP Connection
      \ "sftp"
      22 / Webdav
      \ "webdav"
      23 / Yandex Disk
      \ "yandex"
      24 / http Connection
      \ "http"
      Storage>

       

      box
       


      Box App Client Id - leave blank normally.
      client_id>

       

      Just press enter
       


      Box App Client Secret - leave blank normally.
      client_secret>

       

      Just press enter
       


      Remote config
      Use auto config?
      * Say Y if not sure
      * Say N if you are working on a remote or headless machine
      y) Yes
      n) No
      y/n>

       

      n
       


      For this to work, you will need rclone available on a machine that has a web browser available.
      Execute the following on your machine:
      rclone authorize "box"
      Then paste the result below:
      result>

       

      {"access_token": ... }
       


      --------------------
      [box]
      type = box
      client_id =
      client_secret =
      token = {"access_token": ... }
      --------------------
      y) Yes this is OK
      e) Edit this remote
      d) Delete this remote
      y/e/d>

       

      y
       


      Current remotes:

      Name Type
      ==== ====
      box box

      e) Edit existing remote
      n) New remote
      d) Delete remote
      r) Rename remote
      c) Copy remote
      s) Set configuration password
      q) Quit config
      e/n/d/r/c/s/q>

       

      q

    • Bear in mind that OAuth tokens do not last forever. (How long do they last? Can you make it last forever by using it every so often?)

    • You can now use commands from https://rclone.org/docs/ such as:

      rclone ls box: --max-depth=1
      rclone lsd box: --max-depth=1
  • No labels