sftp: Root user is locked in /root directory

I am a plus user, and wanted to report a bug in sftp client and a
feature request for mount point starting point.

I am logged in as a root in sftp client, the problem is I am locked in
the /root directory and cannot move above me which is /, even though I
am a root.

Please add an option to mount point variable, for example I wanted to
start from / directory.

Welcome to the forum, and thanks — this is a genuinely useful report. Both of your points are valid, and there’s a bit more going on than it looks from the outside.

1. Why you’re locked in /root

This isn’t a permissions problem, and it isn’t about being root.

rclone’s SFTP backend treats a path without a leading / as relative to the login user’s home directory. You log in as root, so home is /root — which means the remote’s “root” in RcloneView maps to /root, not /. To address the real filesystem root, rclone needs the path written with a leading slash: yourremote:/.

RcloneView currently has no way to express that in the file browser — it strips leading slashes when it builds the path, so yourremote: is the only form it can produce. That’s the actual bug: not a locked door, but a missing way to say “start from /”.

For transparency: this came out of an older fix that deliberately made SFTP paths home-relative (a path like remote:/tmp/ was landing on the system /tmp instead of the user’s ~/tmp). That fix was correct as a default, but it removed any way to reach / on purpose. We’ve filed this internally to add it back as an explicit option, without regressing the default.

2. Workaround you can use today — an Alias remote

This gets you to / right now, with no code changes:

  1. New Remote → Virtual category → Alias
  2. In the remote field, type it in directly (don’t use the folder picker): yourremote:/
  3. Save, then open the new alias remote

Its root will be the server’s /. It’s an extra remote in your list rather than a real fix, but it’s fully functional.

3. Mounting from / — this may already work

Good news on your feature request: the Mount dialog’s remote path field is already absolute, unlike the file browser. Setting it to / should mount the server’s filesystem root today. If you try it, I’d be glad to know whether it behaves as expected.

The flip side is worth knowing about, because it’s a real inconsistency we’re fixing: since the browser is home-relative and the mount field is absolute, browsing to a folder and then mounting it can land on the wrong path. If you’re viewing /root/docs in the browser and open the Mount dialog, the path gets filled in as /docs — a different directory on the server. So for now, double-check the mount path field rather than trusting the pre-filled value.

4. One thing that would help us

Could you run this against your server?

rclone lsd yourremote:/

And, from a plain terminal:

sftp root@yourhost
sftp> pwd
sftp> cd /
sftp> ls

This tells us whether your SSH server actually permits / for that account, or whether it confines SFTP sessions to the home directory (some managed SFTP servers and NAS appliances do this by default). The RcloneView issue stands either way — but it tells us whether our fix will actually unblock you, or whether there’s a server-side setting in play as well.

Thanks again for taking the time to write this up clearly — it made the diagnosis much faster.