📄 SKILL.md

← Vault

name: rclone-oauth-headless-vps

description: Authorize rclone Google Drive OAuth on a headless VPS using cloudflared tunnel + pexpect — no browser needed on server

triggers:

- rclone config reconnect headless

- google drive oauth no browser vps

- rclone token expired headless server


Rclone OAuth on Headless VPS via Cloudflared Tunnel

Problem

Rclone needs OAuth authorization via browser, but the VPS has no browser and no X server. OAuth device flow (rclone config reconnect) requires user approval on a machine with browser access.

Solution

1. Start rclone config reconnect with pexpect to answer interactive prompts

2. Rclone creates a local OAuth server on http://127.0.0.1:53682

3. Expose that local port to the public internet using cloudflared tunnel --url http://localhost:53682

4. User visits the resulting public URL in their browser, approves, and rclone receives the token

Prerequisites

Verification

After user approves in browser:

`bash

rclone lsd gdrive: --max-depth 1

`