How to configure Rclone to access your OneDrive/SharePoint
How to configure personal Sharepoint
All the operations are on the MCC cluster DTN node "mcc-dtn.ccs.uky.edu". These will also work for LCC, with some modifications as noted below.
You will need two ssh terminals open to mcc-dtn.ccs.uky.edu. Note that for the second terminal specifically, you should ssh with the the -X flag .
In both terminal, load the same version of rclone in your path (there are multiple versions of rclone installed, use the latest version listed below).
module load ccs/rclone/1.59.2
Starting Rclone Configuration
In the first terminal, run rclone config to start configuring a new connection for you your SharePoint site. enter “n“ to begin creating a new connection and then enter a name for the connection.
[user@login001 ~]$ rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
Enter name for new remote.
name> uky-sharepointWhen prompted for “Storage Options“ like as follows, enter either “32” or enter “onedrive”
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ "fichier"
...
32 / Microsoft OneDrive
\ "onedrive"
...
Storage> onedriveLeave the “OAuth Client Id“, “OAuth Client Secret“, “Choose national cloud region“, and “Edit advanced config“ prompts blank by hitting “Enter”. Once you reach the “Use auto config“ prompt, enter “y” and you will be given a message with a URL that you will need to copy to complete the remainder of the process.
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> y
Authenticating your Linkblue account with Microsoft
In the second terminal, you must either:
For MCC, connect to MCC-DTN and load the Firefox module and open a browser window with the following commands. For LCC, Firefox should already be loaded.
module load ccs/conda/firefox
firefoxIf the prior step does not work, run the following command locally to perform SSH tunneling (
-Lflag) and open a local browser. As an example, if you are on MCC-DTN and the URL given in the last step ishttp://127.0.0.1:53682/..., the ssh command should be.ssh -L 53682:localhost:53682 mcc-dtn.ccs.uky.edu
Whether you opened up the browser locally or on the DTN, paste the URL that was prompted in the first terminal into the window.
The screen will open to a Microsoft login page. Enter your linkblue UKy email address and you will be re-direct to the UKy login page to enter your login information. Once you’ve done so, you should see a Success screen in the browser.
Finalizing Rclone Setup
After this, return to the first terminal and you will be prompted to select a config_type like below. Choose “1” for a OneDrive and “4” (search) for a Sharepoint.
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
1 / OneDrive Personal or Business
\ (onedrive)
2 / Root Sharepoint site
\ (sharepoint)
/ Sharepoint site name or URL
3 | E.g. mystie or https://contoso.sharepoint.com/sites/mysite
\ (url)
4 / Search for a Sharepoint site
\ (search)
5 / Type in driveID (advanced)
\ (driveid)
6 / Type in SiteID (advanced)
\ (siteid)
/ Sharepoint server-relative path (advacned)
7 | E.g. /teams/hr
\ (path)
config_type>
If you selected to search for your Sharepoint, you will need to enter a search term and select the Sharepoint you wish to use from the list of matching site in the following prompt. Confirm you option once you are sure you have selected to correct one.
Option config_search_term.
Search term
Enter a value.
config_search_term> Team
Option config_site.
Select the Site you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (...)
1 / Team Site (https://luky.sharepoint.com/sites/TeamSite)
\ (luky.sharepoint.com,...)
...
config_site> 1
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (...)
1 / Documents (documentLibrary)
\ (...)
config_driveid> 1
Drive OK?
Found drive "root" of type "documentLibrary"
URL: https://;luky.sharepoint.com/sites/TeamSite/Documents
y) Yes (default)
n) No
y/n> y
Once you’ve selected the OneDrive/Sharepoint to connect to, confirm the configuration information to finish the setup. You’ll be taken back to the list of remote connections, now with this new one added to it. Exit rclone configuration by entering “q“.
Configuration complete.
Options:
- type: onedrive
- token: ...
- drive_id: ...
- drive_type: documentLibrary
Keep this "uky-sharepoint" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Name Type
uky-sharepoint drive
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> qNow your rclone is configured to access your OneDrive/Sharepoint. You can confirm that by running the following command.
rclone ls uky-sharepoint: