1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-23 21:44:49 +02:00
Files
rclone/docs/content/remote_setup.md

132 lines
4.1 KiB
Markdown
Raw Normal View History

---
title: "Remote Setup"
description: "Configuring rclone up on a remote / headless machine"
---
# Configuring rclone on a remote / headless machine
Some of the configurations (those involving oauth2) require an
internet-connected web browser.
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.
## Configuring using rclone authorize
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?`.
```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)
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>
```
2025-10-02 15:19:55 +02:00
Then on your main desktop machine, run [rclone authorize](/commands/rclone_authorize/).
```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...
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.
```text
2024-08-16 14:00:11 +00:00
config_token> SECRET_TOKEN
--------------------
[acd12]
2025-10-02 15:19:55 +02:00
client_id =
client_secret =
token = SECRET_TOKEN
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d>
```
## Configuring by copying the config file
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).
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.
```console
rclone config
```
2025-10-02 15:19:55 +02:00
Then locate the file by running [rclone config file](/commands/rclone_config_file).
```console
$ rclone config file
Configuration file is stored at:
/home/user/.rclone.conf
```
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).
## Configuring using SSH Tunnel
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:
```console
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?`.
```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
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...
```
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.