tutorial
May 20, 2021

connect sharepoint documents on linux / mac os with rclone

I recently got an old 2012 MacBook Pro, upgraded it with an ssd and ram. I always wanted to try Ubuntu as a daily driver and so now I have Ubuntu on the machine. Long story short I have several sharepoint sites set up and want to set up the documents (files) on my MacBook, unfortunately there is no simple GUI for this and generally for the simple user no cool way to set this up easily.

rClone

https://rclone.org/

rClone lets us mount multiple storage types on Linux or Mac in Finder or File Explorer. There is no way to connect the sharepoint at first sight, but we can do it using WebDav. First we have to install rclone.

sudo apt-get install rclone

On Ubuntu it was pretty easy, if this doesn't work for you, try the instructions on this page.

Once you have installed rclone you can add a new file storage with this command:

rclone config

Add a new remote connection with n and ENTER and name the new connection.

Now select WebDav, at my version which is 1.50.2 it was Connection Type ID 29, so i typed 29 and hit ENTER.

now rclone asks for a URL, for this we go to our sharepoint webpage and call the documents tab, we should get a URL similar to this:

https://COMPANYNAME.sharepoint.com/sites/OldiCloud/Freigegebene%20Dokumente/Forms/AllItems.aspx

now i deleted the last bit of the url until the name of the shared folder, which resulted in:

https://COMPANYNAME.sharepoint.com/sites/OldiCloud/Freigegebene%20Dokumente/

now give rclone this URL, rclone will ask which kind of webdav connection you try to configure, there should be a option "sharepoint".

select sharepoint and enter your credentials.

at the option bearer_token a went for the default option. after that, i went for no advanced configuration and confirmed my infos at the last step.

now the new connection should be configured. lets mount it.

rclone --vfs-cache-mode writes mount "NAME OF THE CONNECTION": ~/FolderPath/

you should of course exchange the connection name and path with your own settings, but hopefully that goes without saying 😉.

now the files should start syncing.