Centos 挂载 Onedrive 方法——利用 Rclone
Rclone可以挂载OneDrive/Google Drive/Amazon Drive等云存储,同时支持全平台,意味着您可以在Windows、Mac OS、Linux上进行使用。这篇文章主要分享CentOS使用Rclone挂载OneDrive的过程,其它系统或者挂载其它网盘原理和方法大致相同。
在Centos平台安装Rclone
curl https://rclone.org/install.sh | sudo bash
配置Rclone
#打开配置界面
rclone config
此时显示
[harroy@harroy ~]$ rclone config
Current remotes:
Name Type
==== ====
onedrive 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> n
#输入n,表示新建连接
#-------------------------------------------------------------------------
name> onedrive
#为你的连接命名,onedrive即可
#-------------------------------------------------------------------------
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 / 1Fichier
\ "fichier"
2 / Alias for an existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / In memory object storage system.
\ "memory"
17 / Jottacloud
\ "jottacloud"
18 / Koofr
\ "koofr"
19 / Local Disk
\ "local"
20 / Mail.ru Cloud
\ "mailru"
21 / Mega
\ "mega"
22 / Microsoft Azure Blob Storage
\ "azureblob"
23 / Microsoft OneDrive
\ "onedrive"
24 / OpenDrive
\ "opendrive"
25 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
26 / Pcloud
\ "pcloud"
27 / Put.io
\ "putio"
28 / QingCloud Object Storage
\ "qingstor"
29 / SSH/SFTP Connection
\ "sftp"
30 / Sugarsync
\ "sugarsync"
31 / Tardigrade Decentralized Cloud Storage
\ "tardigrade"
32 / Transparently chunk/split large files
\ "chunker"
33 / Union merges the contents of several upstream fs
\ "union"
34 / Webdav
\ "webdav"
35 / Yandex Disk
\ "yandex"
36 / http Connection
\ "http"
37 / premiumize.me
\ "premiumizeme"
38 / seafile
\ "seafile"
Storage> 23
#选择你想要挂载的网盘,选择onedrive的编号即可
#-------------------------------------------------------------------------
** 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 (default)
y/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 (default)
n) No
y/n>
#直接回车即可
#-------------------------------------------------------------------------
"If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=SJZW8XROgC6H6p9VnN63HQ
Log in and authorize rclone for access"
Waiting for code...
#复制该连接到浏览器,输入帐号密码并进行授权,然后回到终端即可看到下面信息
#-------------------------------------------------------------------------
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
#选择onedrive相关编号即可
#-------------------------------------------------------------------------
Found 1 drives, please select the one you want to use:
0: (personal) id=575ada71ced881d6
Chose drive to use:> 0
#将提示的序号0输入即可
#-------------------------------------------------------------------------
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=575ada71ced881d6
Is that okay?
y) Yes (default)
n) No
y/n>
#直接回车即可
#-------------------------------------------------------------------------
--------------------
[test]
type = onedrive
token = {'Your token'} #终端中出现的token会很长,我这里简化了
drive_id = 575ada71ced881d6
drive_type = personal
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
#直接回车即可
#-------------------------------------------------------------------------
到这一步Rclone的配置就已经完成。在使用之前需要做一些准备工作,建立挂载的文件夹。
#没有安装挂载软件的需要先安装挂载软件
yum -y install fuse
#创建挂载目录,请在<User name>输入你的用户名
mkdir -p /home/<User name>/onedrive
挂载onedrive
最后直接挂载onedrive即可使用,你可以每次使用前输入该命令,也可以将该命令存为Bash脚本,或者将该命令配置到启动项中。
rclone mount onedrive:/ /home/<User name>/onedrive
>致力于投身模拟集成电路设计-。-
但常常又不务正业
欢迎小伙伴们跟我沟通交流
邮箱:Harroy@qq.com<