# SFTP user parsing as CLI argument broken

**URL:** <https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955>\
**Category:** Suspected Bug\
**Created:** [June 22, 2026, 7:26pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955 "2026-06-22T19:26:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobiasjakobi](https://forum.rclone.org/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@tobiasjakobi](https://forum.rclone.org/u/tobiasjakobi)\
**Post date:** [June 22, 2026, 7:26pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/1 "2026-06-22T19:26:53Z")

</div>

#### What is the problem you are having with rclone?

Hello there,

I'm currently trying to migrate from sshfs to using rclone in conjunction with it's sftp backend. For this purpose I have created a sort of sftp template. Which looks like this.

```auto
$ cat ~/.config/rclone/rclone.conf 
[template-sftp]
type = sftp
host = localhost
user = username
key_file = ~/.ssh/id_ed25519
known_hosts_file = ~/.ssh/known_hosts
host_key_algorithms = ssh-ed25519 ssh-rsa ecdsa-sha2-nistp256
shell_type = unix
disable_hashcheck = true

```

The plan is to run rclone like this: `rclone mount template-sftp: ~/remote --sftp-host=<remote host> --sftp-user=<remote user>`

This works pretty well, but not quite.

This here works flawlessly.

```auto
$ rclone -vv mount template-sftp: /home/liquid/remote --sftp-host=audioserver.entropy --sftp-user=audiodaemon
2026/06/22 21:16:33 DEBUG : rclone: Version "1.74.1" starting with parameters ["rclone" "-vv" "mount" "template-sftp:" "/home/liquid/remote" "--sftp-host=audioserver.entropy" "--sftp-user=audiodaemon"]
2026/06/22 21:16:33 DEBUG : Creating backend with remote "template-sftp:"
2026/06/22 21:16:33 DEBUG : Using config file from "/home/liquid/.config/rclone/rclone.conf"
2026/06/22 21:16:33 DEBUG : template-sftp: detected overridden config - adding "{QCx-1}" suffix to name
2026/06/22 21:16:33 DEBUG : sftp://audiodaemon@audioserver.entropy:22/: New connection 192.168.0.105:49768->192.168.0.101:22 to "SSH-2.0-OpenSSH_10.3"
...

```

When using a different machine, it fails:

```auto
$ rclone -vv mount template-sftp: /home/liquid/remote --sftp-host=leena.entropy --sftp-user=liquid
2026/06/22 18:27:24 DEBUG : rclone: Version "1.74.1" starting with parameters ["rclone" "-vv" "mount" "template-sftp:" "/home/liquid/remote" "--sftp-host=leena.entropy" "--sftp-user=liquid"]
2026/06/22 18:27:24 DEBUG : Creating backend with remote "template-sftp:"
2026/06/22 18:27:24 DEBUG : Using config file from "/home/liquid/.config/rclone/rclone.conf"
2026/06/22 18:27:24 DEBUG : template-sftp: detected overridden config - adding "{AGoNy}" suffix to name
2026/06/22 18:27:24 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2026/06/22 18:27:24 DEBUG : pacer: Rate limited, increasing sleep to 200ms
2026/06/22 18:27:24 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2026/06/22 18:27:24 DEBUG : pacer: Rate limited, increasing sleep to 400ms

```

This is not a credential problem. The problem is due rclone not using the correct username. Inspecting the SSH log on the server I can see that the login is attempted using `username` as username. I.e. the content of the config file. The `--sftp-user=` argument here seems to be completely ignored.

Now the weirdest part. This here works:

```auto
$ env RCLONE_SFTP_USER=liquid rclone -vv mount template-sftp: /home/liquid/remote --sftp-host=leena.entropy
2026/06/22 20:59:20 DEBUG : Setting --sftp-user "liquid" from environment variable RCLONE_SFTP_USER="liquid"
2026/06/22 20:59:20 DEBUG : rclone: Version "1.74.1" starting with parameters ["rclone" "-vv" "mount" "template-sftp:" "/home/liquid/remote" "--sftp-host=leena.entropy"]
2026/06/22 20:59:20 DEBUG : Creating backend with remote "template-sftp:"
2026/06/22 20:59:20 DEBUG : Using config file from "/home/liquid/.config/rclone/rclone.conf"
2026/06/22 20:59:20 DEBUG : Setting sftp user="liquid" from environment variable RCLONE_SFTP_USER
2026/06/22 20:59:20 DEBUG : template-sftp: detected overridden config - adding "{cT7Dl}" suffix to name
2026/06/22 20:59:20 DEBUG : Setting sftp user="liquid" from environment variable RCLONE_SFTP_USER
2026/06/22 20:59:20 DEBUG : sftp://liquid@leena.entropy:22/: New connection 192.168.0.105:41018->192.168.0.100:22 to "SSH-2.0-OpenSSH_10.3"
2026/06/22 20:59:20 DEBUG : sftp://liquid@leena.entropy:22/: Shell type "unix" from config
2026/06/22 20:59:20 DEBUG : sftp://liquid@leena.entropy:22/: Relative path resolved to "/home/liquid"
...

```

I really can't wrap my head around this. Why does rclone consider the `--sftp-user` argument for the one machine, but completely ignores it for the other one. But then chooses to use it after all, when passing the user through an environment variable?

Sadly I'm not fluent enough in Go to figure out where to look.

Thanks in advance!

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

```auto
$ rclone version
rclone 1.74.1
- os/version: gentoo 2.18 (64 bit)
- os/kernel: 6.18.35-gentoo-r1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.26.3-X:nodwarf5
- go/linking: dynamic
- go/tags: none

```

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

Using the sftp backend.

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

```auto
rclone mount

```

Please see the detail above.

#### The rclone config contents with secrets removed.

I pasted the config above. No secrets in the file to begin with.

#### A log from the command with the `-vv` flag

Log can also be found above.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 22, 2026, 9:05pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/2 "2026-06-22T21:05:58Z")

</div>

I think this is a subtle bug in rclone.

The problem is that on the second machine the users login name is liquid (judging by the /home/liquid) which is the same as --sftp-user=liquid. The --sftp-user defaults to the current user and rclone ignores trying to set it to the default `liquid` value.

This works with environmental variables because they set the default, changing it away from liquid.

Not sure if that makes sense (it is late!) but I'd be grateful if you could report this on GitHub so we can fix it properly.

Thanks

---

<div class="post-metadata">

**Author:** ![tobiasjakobi](https://forum.rclone.org/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@tobiasjakobi](https://forum.rclone.org/u/tobiasjakobi)\
**Post date:** [June 22, 2026, 9:42pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/3 "2026-06-22T21:42:11Z")

</div>

Hey Nick,

thanks for the reply. I'm not sure I follow you here.

The [rclone docs](https://rclone.org/docs/#precedence) clearly states that arguments provided by the commandline should override any default values or values from the config file. That just doesn't seem to be the case here though. Or maybe I completely misunderstand the document?

I agree though that there seems to be some subtle interaction between the local username (the one that calls rclone) and the SFTP user that you want to use for the login on the remote system.

Anyway, concerning the bugreport. For various reasons (please don't ask) I have parted with GitHub recently. No longer have an account there, so I'm afraid I won't be making any bug report here.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 23, 2026, 10:33am UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/4 "2026-06-23T10:33:00Z")

</div>

This is a simple fix luckily.

Please give this a try

~~[v1.75.0-beta.9828.d039cbfe7.fix-default-options](https://beta.rclone.org/branch/fix-default-options/v1.75.0-beta.9828.d039cbfe7.fix-default-options/) on branch [fix-default-options](https://github.com/rclone/rclone/tree/fix-default-options) (uploaded in 15-30 mins)~~

**Update** that didn't build, try this instead

[v1.75.0-beta.9828.437dc4563.fix-default-options](https://beta.rclone.org/branch/fix-default-options/v1.75.0-beta.9828.437dc4563.fix-default-options/) on branch [fix-default-options](https://github.com/rclone/rclone/tree/fix-default-options) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![tobiasjakobi](https://forum.rclone.org/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@tobiasjakobi](https://forum.rclone.org/u/tobiasjakobi)\
**Post date:** [June 24, 2026, 6:17pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/5 "2026-06-24T18:17:19Z")

</div>

Thanks, I've tested the commit (by applying it on top of v1.74.2) and it seems to fix my issue! 🙂

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [June 30, 2026, 1:01pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/7 "2026-06-30T13:01:57Z")

</div>

Thanks for testing @tobiasjakobi

I've merged this to master now which means it will be in [the latest beta](https://beta.rclone.org/) in 15-30 minutes and released in v1.75

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [July 30, 2026, 1:02pm UTC](https://forum.rclone.org/t/sftp-user-parsing-as-cli-argument-broken/53955/8 "2026-07-30T13:02:24Z")

</div>

Closed on July 30, 2026, 1:02pm UTC

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