栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

在无浏览器的主机上完成rclone配置google drive的auth流程

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在无浏览器的主机上完成rclone配置google drive的auth流程

Rclone是一款的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据。
但是在配置的时候,需要通过浏览器完成auth。如果远程主机没有浏览器,官方给出的提示是在有浏览器的机器上也安装一个rclone,通过有浏览器的主机完成auth操作。

For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
	rclone authorize "drive" "xxxxxxxxxxxxxxxxxxxxxxxx"
Then paste the result.

或者在有浏览器的机器上也安装配置好rclone,然后将rclone.conf复制到远程主机的 ~/.config/rclone/位置。

但是除了这个方法,还有一个更简单的无需本地安装的方法:

1. 首先通过ssh连接建立一个tunnel:
ssh -L localhost:53682:localhost:53682 user@remote_server

user为远程主机用户名,remote_server为远程主机地址。

2. 在远程主机进行配置操作
rclone config

然后走到如下选项的时候,输入n:

Edit advanced config? (y/n)
y) Yes
n) No
y/n> n

如下选项的时候,输入y:

Remote config
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

然后将随后出现的网址粘贴到本地机器的浏览器上即可:

2022/05/14 06:40:24 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxx
2022/05/14 06:40:24 NOTICE: Log in and authorize rclone for access
2022/05/14 06:40:24 NOTICE: Waiting for code...

成功后会出现Got code提示:

2022/05/14 06:41:26 NOTICE: Got code`

然后Configure this as a Shared Drive (Team Drive)?输入N即可。

参考资料:

  1. Configure Rclone as if Local - Office of Research Computing - BYU
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/888021.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号