Ubuntu – How to setup OneDrive in Ubuntu 17.04

configurationmicrosoft

Problem with OneDrive. Recently I've installed OneDrive in my PC (Ubuntu 17.04)
but I'm not able to configure or not able to sign in OneDrive through the terminal.
Actually I've strucked here. Please look on to this

jujube@jujube:~$ onedrive
Authorize this app visiting:

https://login.live.com/oauth20_authorize.srf?client_id=000000004C15842F&scope=onedrive.readwrite%20offline_access&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf

Enter the response uri: https://login.microsoftonline.com/189de737-c93a-4f5a-8b68-6f4ca9941912/oauth2/authorize?client_id=00000003-0000-0ff1-ce00-000000000000&response_mode=form_post&response_type=code%20id_token&resource=00000003-0000-0ff1-ce00-000000000000&scope=openid&nonce=1263013103B7E6782803F03D5629B7D0FB1A68D46E17D09C-4B1B73911F92DE22FA330783ACEDE04C7C9991BB38BA7FCD9E3A9A900E0DB6AC&redirect_uri=https:%2F%2Fhclo365-my.sharepoint.com%2F_forms%2Fdefault.aspx&state=0&client-request-id=3fc31b9e-70d1-4000-78af-c23eabf4934b
Invalid uri
Could not initialize the OneDrive API
jujube@jujube:~$

Best Answer

  • I tried installing the package onedrive and it works just fine

    sudo apt-get install onedrive
    

    post install, run command

    onedrive
    

    This will provide a URI and ask you for a URI in return. Click the URI and login to your onedrive account (this package works only with personal onedrive for now). Good thing is it also works with two factor authentication - no app password is needed.

    The URI will show a blank page, copy the web URI and paste it into the terminal where the onedrive command prompted for uri.

    That's it. The tool will download entire Onedrive contents to $HOME/OneDrive directory.

    The drive can be sync'ed in real time with

    onedrive -m
    

    I found the above command useful.

    Any time simply run onedrive to sync the files. Use manual to find much more options to configure the sync to your need

    man onedrive
    
  • Related Question