How to restrict rclone serve to a single IP:Port?

What is the problem you are having with rclone?

Is there a way to use the addr option to restrict rclone serve to only allow a single ip:port to connect? For example, if I only wanted to connect at port 5555?

For example, using rclone serve sftp

As I understand:

--addr=localhost:5555 or --addr= or --addr=IP_OF_SERVER:5555 will make it available only on the serving computer

--addr=:5555 will make it available over the internet (if the port is forwarded) and make it available over LAN

--addr= doesn't seem to work if I want to listen only to

Run the command 'rclone version' and share the full output of the command.

rclone v1.60.1

  • os/version: Microsoft Windows 11 Education 21H2 (64 bit)
  • os/kernel: 10.0.22000.1281 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.19.3
  • go/linking: static
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

rclone serve

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone serve sftp remote:path --addr:?

It's very helpful for us to use the help and support template.

-addr isn't a flag for rclone. Do you mean rc-addr?

--addr is for any of the rclone serve commands

No, you have to do that in the firewall of your computer/network. rclone doesn't contain a firewall, and shouldn't.

Tip: Try searching for "addr" in the list of flags, then you see the flags related to adresses.

Great as I thought you were talking about rclone rc comands since the help template wasn't used :frowning:

I have no issues with making a specific IP / port:

felix@gemini:~$ netstat -an | grep 4495
tcp        0      0*               LISTEN
clone serve http GD: --addr -vv
2022/12/16 11:11:28 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2022/12/16 11:11:28 DEBUG : rclone: Version "v1.60.1" starting with parameters ["rclone" "serve" "http" "GD:" "--addr" "" "-vv"]
2022/12/16 11:11:28 DEBUG : Creating backend with remote "GD:"
2022/12/16 11:11:28 DEBUG : Using config file from "/opt/rclone/rclone.conf"
2022/12/16 11:11:28 DEBUG : GD: Loaded invalid token from config file - ignoring
2022/12/16 11:11:28 DEBUG : Saving config "token" in section "GD" of the config file
2022/12/16 11:11:28 DEBUG : Keeping previous permissions for config file: -rwxrwxr-x
2022/12/16 11:11:28 DEBUG : GD: Saved new token in config file
2022/12/16 11:12:28 INFO  :
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:       1m0.0s

2022/12/16 11:12:28 DEBUG : Google drive root '': Checking for changes on remote
2022/12/16 11:13:28 INFO  :
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:       2m0.0s

2022/12/16 11:13:28 DEBUG : Google drive root '': Checking for changes on remote

Would be great to know what you are running / error log.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.