ubuntu linux 挂载,在Ubuntu Linux命令行上挂载OneDrive

在Ubuntu上挂载OneDrive

1.下载并安装Rclone

sudo apt install rclone

或下载最新的

wget https://downloads.rclone.org/v1.42/rclone-v1.42-linux-amd64.deb

sudo apt install ./rclone-v1.42-linux-amd64.deb

2.将新的OneDrive遥控器添加到Rclone

rclone config

通过输入并按以下 键,选择“ 新建远程”选项 :nEnter

$ rclone config

Current remotes:

Name Type

==== ====

mega mega

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

输入新遥控器的名称,此处onedrive使用:

name> onedrive

按下后Enter,将显示受支持的云存储服务列表。您需要通过输入相应的数字来选择Microsoft OneDrive选项(现在为“ 16”,但将来可能会更改):

Type of storage to configure.

Choose a number from below, or type in your own value

[snip]

...

...

xx / Microsoft OneDrive

\ "onedrive"

...

...

[snip]

Storage> onedrive

在接下来的两个步骤中,请按Enter而不输入任何信息,因为无需输入Microsoft App Client ID或Secret:

Microsoft App Client Id

Leave blank normally.

client_id>

Microsoft App Client Secret - leave blank normally.

client_secret>

选择OneDrive帐户类型(输入 bBusiness或pPersonal OneDrive帐户):

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

根据您的设置,您必须输入自动配置或手动进行下一步。对于桌面用户,键入y 以使用自动配置:

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> y

应在默认的Web浏览器中打开一个新选项卡,要求您授予Rclone访问OneDrive帐户的权限。允许它,您可以关闭选项卡。

Rclone在本地计算机上(端口53682上)运行Web服务器以检索身份验证令牌。如果使用防火墙,则可能需要暂时取消阻止它。

现在,您需要检查一切是否正确,并通过输入来保存设置y:

[onedrive]

type = onedrive

client_id =

client_secret =

token = {"access_token":"GoKSt5YMioiuCWX1KOuo8QT0Fwy+Y6ZeX7M","token_type":"bearer","refresh_token":"7OMvoEAO3l*8BbhS2AMxpTbJW0Y6np9cdql!bwEdYAhJ6XBG0tnR0UK","expiry":"2018-07-26T15:15:13.696368366+03:00"}

--------------------

y) Yes this is OK

e) Edit this remote

d) Delete this remote

y/e/d> y

输入q以下内容以退出Rclone配置:

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> q

3.创建一个新文件夹

mkdir ~/OneDrive

4.挂载OneDrive

rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive

您可以通过按Ctrl+ c 关闭Rclone 来停止和卸载它。

5.(可选)在系统启动时挂载OneDrive

要在启动时安装OneDrive,请打开“启动应用程序”,然后在“启动应用程序”中单击“添加”。

单击添加后,使用以下命令:

Name: Rclone OneDrive Mount

Command: sh -c "rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive"

还有其他自动安装OneDrive的方法,例如在/etc/fstab file,使用systemd等中添加一行。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值