SFTP remote issue - "couldn't connect to ssh-agent: SSH agent requested but SSH_AUTH_SOCK not-specified."

What is the problem you are having with rclone?

I'm trying to connect to an SFTP remote. The local machine & the remote machine are both Raspberry Pis. They're connected via Tailscale and I have Tailscale SSH enabled, which means it's possible to SSH into the remote machine without any authentication, and so I have my .conf file set up so this remote doesn't try any authentication - no password or key file are given, and key_use_agent is set to false.

When I use any rclone commands, I get an error:

Failed to create file system for "remote:": couldn't connect to ssh-agent: SSH agent requested but SSH_AUTH_SOCK not-specified.

If key_use_agent is set to false, why is it trying to use ssh-agent? If I set eval "$(ssh-agent -s)" then the command does work without this error, but I'm not sure why it would need ssh-agent at all?

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

rclone v1.69.2

  • os/version: raspbian 12.11 (64 bit)
  • os/kernel: 6.12.25+rpt-rpi-2712 (aarch64)
  • os/type: linux
  • os/arch: arm64 (ARMv8 compatible)
  • go/version: go1.24.2
  • go/linking: static
  • go/tags: none

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

SFTP

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

rclone lsd remote:

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[remote]
type = sftp
host = XXX
user = XXX
shell_type = unix
key_use_agent = false

A log from the command that you were trying to run with the -vv flag

2025/05/20 14:44:35 DEBUG : rclone: Version "v1.69.2" starting with parameters ["rclone" "--config" "/path/to/rclone.conf" "-vv" "lsd" "remote:"]
2025/05/20 14:44:35 DEBUG : Creating backend with remote "remote:"
2025/05/20 14:44:35 DEBUG : Using config file from "/path/to/rclone.conf"
2025/05/20 14:44:35 CRITICAL: Failed to create file system for "remote:": couldn't connect to ssh-agent: SSH agent requested but SSH_AUTH_SOCK not-specified

Because you need keys (Tailscale node keys to be precise) for SSH authentication. Either provided explicitly or via ssh-agent.

1 Like

Gotcha, thanks!

1 Like

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