How to access OneDrive on Debian

Access your files stored in OneDrive using rclone command line program to sync files and directories to and from cloud storage and FUSE Filesystem in Userspace filesystem.

Install rclone program and fuse utilities.

$ sudo apt install rclone fuse

Check rclone version.

$  rclone version --check
yours:  1.45         
latest: 1.49.1        (released 2019-08-28)
  upgrade: https://downloads.rclone.org/v1.49.1
beta:   1.49.0.31     (released 2019-09-07)
  upgrade: https://beta.rclone.org/v1.49.0-031-g2298834e-beta

Create OneDrive configuration.

$ rclone config
2019/09/07 18:59:48 NOTICE: Config file "/home/milosz/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> onedrive_personal
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / A stackable unification remote, which can appear to merge the contents of several remotes
   \ "union"
 2 / Alias for a existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Dropbox
   \ "dropbox"
 9 / Encrypt/Decrypt a remote
   \ "crypt"
10 / FTP Connection
   \ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
12 / Google Drive
   \ "drive"
13 / Hubic
   \ "hubic"
14 / JottaCloud
   \ "jottacloud"
15 / Local Disk
   \ "local"
16 / Microsoft Azure Blob Storage
   \ "azureblob"
17 / Microsoft OneDrive
   \ "onedrive"
18 / OpenDrive
   \ "opendrive"
19 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
20 / Pcloud
   \ "pcloud"
21 / SSH/SFTP Connection
   \ "sftp"
22 / Webdav
   \ "webdav"
23 / Yandex Disk
   \ "yandex"
24 / http Connection
   \ "http"
Storage> 17
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
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> Y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...

Let this app access your info

Got code
Choose a number from below, or type in an existing value
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Root Sharepoint site
   \ "sharepoint"
 3 / Type in driveID
   \ "driveid"
 4 / Type in SiteID
   \ "siteid"
 5 / Search a Sharepoint site
   \ "search"
Your choice> 1
Found 1 drives, please select the one you want to use:
0:  (personal) id=3643e77d8391acb2
Chose drive to use:> 0
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=3643e77d8391acb2
Is that okay?
y) Yes
n) No
y/n> y
--------------------
[onedrive_personal]
token = {"access_token":"nyRGc7rBKrXg4q2TN8YZsT0njX6kh96O7U0o8trv","expiry":"2019-09-07T20:04:32.835065159Z"}
drive_id = 3643e77d8391acb2
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
onedrive_personal    onedrive

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

Display location of the configuration file.

$ rclone config file
Configuration file is stored at:
/home/milosz/.config/rclone/rclone.conf

Inspect configuration file.

$ rclone config show
[onedrive_personal]
type = onedrive
token = {"access_token":"nyRGc7rBKrXg4q2TN8YZsT0njX6kh96O7U0o8trv","expiry":"2019-09-07T20:04:32.835065159Z"}
drive_id = 3643e77d8391acb2
drive_type = personal

Create mount directory.

$ mkdir ~/onedrive_personal

Mount OneDrive using FUSE.

$ rclone mount --daemon --vfs-cache-mode full onedrive_personal: ~/onedrive_personal
You can use writes instead of full to conserve local disk space.

Inspect quota on the mounted remote.

$ rclone about  onedrive_personal
Total:   1.103T
Used:    1.188G
Free:    1.101T

You are free to access your files.

$ ls ~/onedrive_personal/
Dokumenty  Obrazy  Załączniki
There is more to it, so I strongly suggest to read rclone manual page.

Remember to inspect account permissions and remove stale applications.

Microsoft Account

Other solutions

Check out Free Client for OneDrive on Linux and Insync paid client.