与你分享
互联网的方方面面

rclone更新Onedrive client_secret

一、获取新客户端密码

1、浏览器登录Microsoft Entra

https://entra.microsoft.com/#home

2、定位到应用注册>所有应用程序,找到之前创建的应用程序

3、打开该应用程序,定位到证书和密码>客户端密码

4、重新创建新客户端密码

5、创建完成后,保留新客户端密码的值

二、重新配置rclone

1、Linux服务器执行命令刷新rclone配置文件:

rclone config reconnect onedrive01:

2、进行到以下步骤:

root@localhost:~# rclone config reconnect onedrive01:
Already have a token - refresh?
y) Yes (default)
n) No
y/n> y

Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.

y) Yes (default)
n) No
y/n> y

2026/01/18 12:38:49 NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
2026/01/18 12:38:49 ERROR : Failed to open browser automatically (exec: "xdg-open": executable file not found in $PATH) - please go to the following link: http://127.0.0.1:53682/auth?state=GwWXLt3OGSugsYM4-ZL1yA
2026/01/18 12:38:49 NOTICE: Log in and authorize rclone for access
2026/01/18 12:38:49 NOTICE: Waiting for code...

3、Windows电脑中打开PowerShell,执行以下命令:

ssh -p 22 -L 53682:127.0.0.1:53682 root@linux_ip

4、浏览器打开链接

http://127.0.0.1:53682/auth?state=GwWXLt3OGSugsYM4-ZL1yA

输入Onedrive账号密码

5、回到Linux服务器,继续执行步骤

2026/01/18 12:39:16 NOTICE: Got code
Option config_type.
Type of connection
Choose a number from below, or type in an existing value of type string.
Press Enter for the default (onedrive).
 1 / OneDrive Personal or Business
   \ (onedrive)
 2 / Root Sharepoint site
   \ (sharepoint)
   / Sharepoint site name or URL
 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
   \ (url)
 4 / Search for a Sharepoint site
   \ (search)
 5 / Type in driveID (advanced)
   \ (driveid)
 6 / Type in SiteID (advanced)
   \ (siteid)
   / Sharepoint server-relative path (advanced)
 7 | E.g. /teams/hr
   \ (path)
config_type> 1

Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own value of type string.
Press Enter for the default (xxxxx).
 1 / OneDrive (business)
   \ (xxxxx)
config_driveid> 1

Drive OK?

Found drive "root" of type "business"
URL: https://xxxxx-my.sharepoint.com/personal/xxxxx/Documents

y) Yes (default)
n) No
y/n> y

root@localhost:~# 

6、此时完成配置刷新

三、重新挂载

Linux服务器中执行以下命令完成挂载:

rclone mount onedrive01: /onedrive01 --allow-other --allow-non-empty --vfs-cache-mode writes --daemon

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《rclone更新Onedrive client_secret》
文章链接:https://wph.im/289.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。