之前发了个Google Drive网盘挂载教程,参考:在Debian/Ubuntu上应用rclone挂载Google Drive网盘,然后伏笔VPS(vps.fubi.hk)想用同一的方式尝尝挂载OneDrive网盘,不过卡在了受权那边,然后除非恳求Vicer大佬帮手处理了,这边分享下挂载教程。
提醒:本教程挂载OneDrive for Business和小我私家版的方式都一样,这边以小我私家版为参考。
客户端受权
在本土Windows电脑左右载rclone,下载地点:https://rclone.org/downloads/。然后解压出来,譬如我解压到D盘,文献夹定名rclone,此刻点击Win+R,然后输入cmd,决定。再输入以下号令:
cd /d d:\rclone
rclone authorize "onedrive"
会涌现以下信息:
C:\Users\Administrator>cd /d d:\rclone
d:\rclone>rclone authorize "onedrive"
2018/01/23 20:28:56 NOTICE: Config file "C:\\Users\\Administrator\\.config\\rclo
ne\\rclone.conf" not found - using defaults
Choose OneDrive account type?
* Say b for a OneDrive business account
* Say p for a personal OneDrive account
b) Business
p) Personal
b/p> p #这边挑选小我私家版,你想挂载Business就挑选b
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...
Got code
Paste the following into your remote machine --->
{"access_token":"xxxx"} #请复制{xx}全部情节,后头必要用到
<---End paste
安装rclone
本教程只合用Debian/Ubuntu体系,如其你是CentOS,请参考:https://rclone.org/install/,安装rclone。挂载方式和上面差未几。
1、安装rclone
wget https://www.moerats.com/usr/shell/rclone_debian.sh && bash rclone_debian.sh
2、初始化配备
rclone config
会涌现以下信息:
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> Rats #随意填,后头要用到
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Box
\ "box"
5 / Cache a remote
\ "cache"
6 / Dropbox
\ "dropbox"
7 / Encrypt/Decrypt a remote
\ "crypt"
8 / FTP Connection
\ "ftp"
9 / Google Cloud Storage (this is not Google Drive)
\ "谷歌 cloud storage"
10 / Google Drive
\ "drive"
11 / Hubic
\ "hubic"
12 / Local Disk
\ "local"
13 / Microsoft Azure Blob Storage
\ "azureblob"
14 / Microsoft OneDrive
\ "onedrive"
15 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
16 / Pcloud
\ "pcloud"
17 / QingCloud Object Storage
\ "qingstor"
18 / SSH/SFTP Connection
\ "sftp"
19 / Webdav
\ "webdav"
20 / Yandex Disk
\ "yandex"
21 / http Connection
\ "http"
Storage> 14 #挑选14,Microsoft OneDrive
Microsoft App Client Id - leave blank normally.
client_id> #留空
Microsoft App Client Secret - leave blank normally.
client_secret> #留空
Remote config
Choose OneDrive account type?
* Say b for a OneDrive business account
* Say p for a personal OneDrive account
b) Business
p) Personal
b/p> p #这边挑选小我私家版,你想挂载Business就挑选b
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> n #挑选n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine:
rclone authorize "onedrive"
Then paste the result below:
result> {"access_token":""} #输入之前在客户端受权的情节
--------------------
[Rats]
client_id =
client_secret =
token = {"access_token":""}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y 挑选y
Current remotes:
Name Type
==== ====
Rats 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 #挑选q退出
挂载
1、挂载为磁盘
#新建本土文献夹,途径本人定,即上面的LocalFolder
mkdir /root/OneDrive
#挂载为磁盘
rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
DriveName为初始化配备填的name,Folder为OneDrive里的文献夹,LocalFolder为VPS上的本土文献夹。
如其挂载历程中涌现NOTICE: One drive root 'test': poll-interval is not supported by this remote毛病,能够忽视该毛病。
挂载胜利后,输入df -h号令检察便可!
2、卸载磁盘
fusermount -qzu LocalFolder
自启动
1、下载并编纂脚本
应用号令:
wget https://www.moerats.com/usr/shell/rcloned && nano rcloned
修正一下情节:
NAME="" #rclone name名,及配备时输入的Name
REMOTE='' #长途文献夹,OneDrive网盘里的挂载的一个文献夹
LOCAL='' #挂载地点,VPS本土挂载目录
2、设置自启
应用号令:
#Debian体系
apt-get install sudo -y
#设置自启
mv rcloned /etc/init.d/rcloned
chmod +x /etc/init.d/rcloned
update-rc.d -f rcloned defaults
bash /etc/init.d/rcloned start
检测信息显现rclone启动胜利便可。
最末咱们便可以使用OneDrive for Business为Linux VPS增添5TB的当空了。
网友评论