2016-01-07 15:20:32 +00:00
|
|
|
---
|
|
|
|
|
title: "Remote Setup"
|
|
|
|
|
description: "Configuring rclone up on a remote / headless machine"
|
|
|
|
|
---
|
|
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
# Configuring rclone on a remote / headless machine
|
2016-01-07 15:20:32 +00:00
|
|
|
|
|
|
|
|
Some of the configurations (those involving oauth2) require an
|
2025-10-02 14:52:58 +02:00
|
|
|
internet-connected web browser.
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
If you are trying to set rclone up on a remote or headless machine with no
|
|
|
|
|
browser available on it (e.g. a NAS or a server in a datacenter), then
|
|
|
|
|
you will need to use an alternative means of configuration. There are
|
|
|
|
|
three ways of doing it, described below.
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
## Configuring using rclone authorize
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
On the headless machine run [rclone config](/commands/rclone_config), but
|
2025-11-01 16:47:09 +01:00
|
|
|
answer `N` to the question `Use web browser to automatically authenticate
|
|
|
|
|
rclone with remote?`.
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
```text
|
2025-10-02 15:19:55 +02:00
|
|
|
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.
|
2024-08-16 14:00:11 +00:00
|
|
|
|
2020-05-04 10:40:26 +01:00
|
|
|
y) Yes (default)
|
2016-01-07 15:20:32 +00:00
|
|
|
n) No
|
|
|
|
|
y/n> n
|
2024-08-16 14:00:11 +00:00
|
|
|
|
|
|
|
|
Option config_token.
|
2020-05-04 10:40:26 +01:00
|
|
|
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):
|
2025-10-02 15:19:55 +02:00
|
|
|
rclone authorize "onedrive"
|
2024-08-16 14:00:11 +00:00
|
|
|
Then paste the result.
|
|
|
|
|
Enter a value.
|
|
|
|
|
config_token>
|
2016-01-07 15:20:32 +00:00
|
|
|
```
|
|
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Then on your main desktop machine, run [rclone authorize](/commands/rclone_authorize/).
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
```text
|
2024-08-16 14:00:11 +00:00
|
|
|
rclone authorize "onedrive"
|
2025-10-02 15:19:55 +02:00
|
|
|
NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
|
|
|
|
|
NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
|
NOTICE: Log in and authorize rclone for access
|
|
|
|
|
NOTICE: Waiting for code...
|
|
|
|
|
|
2016-01-07 15:20:32 +00:00
|
|
|
Got code
|
|
|
|
|
Paste the following into your remote machine --->
|
|
|
|
|
SECRET_TOKEN
|
|
|
|
|
<---End paste
|
|
|
|
|
```
|
|
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Then back to the headless machine, paste in the code.
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
```text
|
2024-08-16 14:00:11 +00:00
|
|
|
config_token> SECRET_TOKEN
|
2016-01-07 15:20:32 +00:00
|
|
|
--------------------
|
|
|
|
|
[acd12]
|
2025-10-02 15:19:55 +02:00
|
|
|
client_id =
|
|
|
|
|
client_secret =
|
2016-01-07 15:20:32 +00:00
|
|
|
token = SECRET_TOKEN
|
|
|
|
|
--------------------
|
|
|
|
|
y) Yes this is OK
|
|
|
|
|
e) Edit this remote
|
|
|
|
|
d) Delete this remote
|
|
|
|
|
y/e/d>
|
|
|
|
|
```
|
|
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
## Configuring by copying the config file
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Rclone stores all of its configuration in a single file. This can easily be
|
|
|
|
|
copied to configure a remote rclone (although some backends does not support
|
|
|
|
|
reusing the same configuration, consult your backend documentation to be
|
|
|
|
|
sure).
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Start by running [rclone config](/commands/rclone_config) to create the
|
|
|
|
|
configuration file on your desktop machine.
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-31 21:58:24 +01:00
|
|
|
```console
|
2025-08-25 00:00:48 +02:00
|
|
|
rclone config
|
|
|
|
|
```
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Then locate the file by running [rclone config file](/commands/rclone_config_file).
|
2016-01-07 15:20:32 +00:00
|
|
|
|
2025-10-31 21:58:24 +01:00
|
|
|
```console
|
2019-01-13 17:56:57 +00:00
|
|
|
$ rclone config file
|
|
|
|
|
Configuration file is stored at:
|
|
|
|
|
/home/user/.rclone.conf
|
2016-01-07 15:20:32 +00:00
|
|
|
```
|
|
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Finally, transfer the file to the remote machine (scp, cut paste, ftp, sftp, etc.)
|
|
|
|
|
and place it in the correct location (use [rclone config file](/commands/rclone_config_file)
|
|
|
|
|
on the remote machine to find out where).
|
2022-05-19 19:59:53 +08:00
|
|
|
|
2025-08-25 00:00:48 +02:00
|
|
|
## Configuring using SSH Tunnel
|
2022-05-19 19:59:53 +08:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
If you have an SSH client installed on your local machine, you can set up an
|
|
|
|
|
SSH tunnel to redirect the port 53682 into the headless machine by using the
|
|
|
|
|
following command:
|
2025-08-25 00:00:48 +02:00
|
|
|
|
2025-10-31 21:58:24 +01:00
|
|
|
```console
|
2022-05-19 19:59:53 +08:00
|
|
|
ssh -L localhost:53682:localhost:53682 username@remote_server
|
|
|
|
|
```
|
|
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Then on the headless machine run [rclone config](/commands/rclone_config) and
|
2025-11-01 16:47:09 +01:00
|
|
|
answer `Y` to the question `Use web browser to automatically authenticate rclone
|
|
|
|
|
with remote?`.
|
2025-08-25 00:00:48 +02:00
|
|
|
|
|
|
|
|
```text
|
2025-10-02 15:19:55 +02:00
|
|
|
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.
|
2024-08-16 14:02:37 +00:00
|
|
|
|
2022-05-19 19:59:53 +08:00
|
|
|
y) Yes (default)
|
|
|
|
|
n) No
|
|
|
|
|
y/n> y
|
2025-10-02 15:19:55 +02:00
|
|
|
NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
|
|
|
|
|
NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
|
NOTICE: Log in and authorize rclone for access
|
|
|
|
|
NOTICE: Waiting for code...
|
2022-05-19 19:59:53 +08:00
|
|
|
```
|
2025-08-25 00:00:48 +02:00
|
|
|
|
2025-10-02 15:19:55 +02:00
|
|
|
Finally, copy and paste the presented URL `http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx`
|
|
|
|
|
to the browser on your local machine, complete the auth and you are done.
|