I am trying to client/server approach using Rclone behind xinetd. However, I cannot connect. Any help appreciated.
Server xinetd config is below.
service rclone-sftp
{
disable = no
socket_type = stream
protocol = tcp
port = 9000
wait = no
user = root
server = /usr/bin/rclone
server_args = serve sftp /home/***/temp --stdio --config="" --log-file=/tmp/rclone.log --log-level=DEBUG --retries=5 --low-level-retries=5
type = UNLISTED
log_on_success += HOST PID USERID
log_on_failure += HOST USERID
}
Client command is below. Server log is given in “A log from the command with the -vv flag“ section.
Run the command 'rclone version' and share the full output of the command.
rclone v1.71.0
os/version: debian trixie/sid (64 bit)
os/kernel: 6.12.46-x64v3-xanmod1 (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.25.0
go/linking: static
go/tags: none
Which cloud storage system are you using? (eg Google Drive) Local
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Client connect command:
rclone ls --sftp-host=127.0.0.1 --sftp-port=9000 :sftp:
The rclone config contents with secrets removed.
No config
A log from the command with the -vv flag
Server log:
2025/09/23 16:56:57 DEBUG : 5 go routines active
2025/09/23 16:56:57 NOTICE: Failed to sftp: completed with error: packet too long
2025/09/23 16:56:59 DEBUG : rclone: Version "v1.71.0" starting with parameters ["rclone" "serve" "sftp" "/home/denis/temp" "--stdio" "--config=\"\"" "--log-file=/tmp/rclone.log" "--log-level=DEBUG" "--retries=5" "--low-level-retries=5"]
2025/09/23 16:56:59 DEBUG : Creating backend with remote "/home/denis/temp"
2025/09/23 16:56:59 NOTICE: Config file "/\"\"" not found - using defaults
2025/09/23 16:56:59 INFO : Local file system at /home/denis/temp: poll-interval is not supported by this remote
2025/09/23 16:56:59 DEBUG : stdio: Starting SFTP server
2025/09/23 16:56:59 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/09/23 16:56:59 DEBUG : 5 go routines active
2025/09/23 16:56:59 NOTICE: Failed to sftp: completed with error: packet too long
Client log:
2025/09/23 16:18:23 CRITICAL: Failed to create file system for ":sftp:": NewFs: couldn't connect SSH: ssh: handshake failed: read tcp 127.0.0.1:58614->127.0.0.1:9000: read: connection reset by peer
Sorry. But I don’t get it. I provided the full xinetd config. It contains full server command line with debug enabled. –stdio parameter prevents server from starting from terminal.
$ rclone serve sftp /home/denis/temp --stdio --config="" --log-level=DEBUG --retries=5 --low-level-retries=5
2025/09/23 17:06:13 DEBUG : rclone: Version "v1.71.0" starting with parameters ["rclone" "serve" "sftp" "/home/denis/temp" "--stdio" "--config=" "--log-level=DEBUG" "--retries=5" "--low-level-retries=5"]
2025/09/23 17:06:13 DEBUG : Creating backend with remote "/home/denis/temp"
2025/09/23 17:06:13 DEBUG : Using config file from ""
2025/09/23 17:06:13 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/09/23 17:06:13 DEBUG : 4 go routines active
2025/09/23 17:06:13 NOTICE: Failed to sftp: refusing to run SFTP server directly on a terminal. Please let sshd start rclone, by connecting with sftp or sshfs
I try to find some way to trigger ZFS snapshot creation on server BEFORE rclone bisync. Thus I need something to invoke my script and only after successful snapshot creation proceed with sync via rclone. And as I don’t use “systemd & like”, I am trying to rely on old & “true” xinetd which is specifically made for script interactions via stdin<–>sockets.
I’d like to get a fully automatic 2-way replication & backup/snapshots between 2+ Linux servers. Thus ZFS snapshots provide backups (yearly, monthly, etc.) as needed.
Other than that it’s pretty similar to VSS approach you’ve mentioned.
Your script does not seem to snapshot destination for backup before starting (bi)sync. You are doing only source snapshot for rclone. So it’s not entirely true comparison.
Same issue can be reproduced when using ncat instead of xinetd.
Server output:
$ ncat -l 6000 -c 'rclone serve sftp /tmp --config="" --stdio --user="test" --pass="test" -vvv' --keep-open
2025/09/24 10:51:23 DEBUG : rclone: Version "v1.71.0" starting with parameters ["rclone" "serve" "sftp" "/tmp" "--config=" "--stdio" "--user=test" "--pass=test" "-vvv"]
2025/09/24 10:51:23 DEBUG : Creating backend with remote "/tmp"
2025/09/24 10:51:23 DEBUG : Using config file from ""
2025/09/24 10:51:23 INFO : Local file system at /tmp: poll-interval is not supported by this remote
2025/09/24 10:51:23 DEBUG : stdio: Starting SFTP server
2025/09/24 10:51:23 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/09/24 10:51:23 DEBUG : 4 go routines active
2025/09/24 10:51:23 NOTICE: Failed to sftp: completed with error: packet too long