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即可。
参考资料:
- Configure Rclone as if Local - Office of Research Computing - BYU



