SFTP Start or Root Path

Hello,

What is the problem you are having with rclone?

I wont to set SFTP Start/Root Path. I Cant find the specified Option.

For Example: NC:/home/Username/Unraid/Rclone

So SFTP Start/can only Access to this Path and his Subdata, not to /, /home/Username ..... and Co.
So that NC:/home/Username/Unraid/Rclone is the root folder. (NC:/)

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

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
-->

/data # rclone version
rclone v1.62.2
- os/version: alpine 3.17.2 (64 bit)
- os/kernel: 5.19.17-Unraid (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none
/data #

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

A Nextcloud with SFTP Access.

Many Thanks!

Greetings

Revan335

might try something like

[sftpserver]
type = sftp
host = redacted
user = redacted
key_file = redacted

[root]
type = alias
remote = sftpserver:nameofdir

rclone lsd root:

tho that will protect against
rclone lsd sftpserver:nameofsecretdir

so might need to lock down that sftp server

I can not configure this in the config of the SFTP Connection directly?

not an expert, but if you give rclone a username, then rclone can access anything that username can.
that is why i mentioned, to lock down the server. give rclone a locked down user.

perhaps another rcloner has an idea?

The alias idea will stop accidents but if you need a 100% guarantee then you'll have to configure the server.

Rclone can't do it with a setting and if it could it could be changed by the user.

Its not working or i used it wrong.

Current remotes:

Name                 Type
====                 ====
NC                   sftp
NC-Crypt             crypt
NC-Remote            alias

/data # rclone lsd NC: is wrong. NC-Remote is the correct Path.

please post:

  • the full output of rclone lsd NC: -vv
  • the redacted contents of your remotes?
/data # rclone lsd NC: -vv
2023/06/13 21:11:50 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "lsd" "NC:" "-vv"]
2023/06/13 21:11:50 DEBUG : Creating backend with remote "NC:"
2023/06/13 21:11:50 DEBUG : Using config file from "/config/rclone/rclone.conf"
2023/06/13 21:11:50 DEBUG : sftp://User@Adresse:Port/: New connection IP:Port->IP:Port to "SSH-2.0-OpenSSH_7.4"
2023/06/13 21:11:50 DEBUG : sftp://User@Adresse:Port/: Shell type "unix" from config
2023/06/13 21:11:50 DEBUG : sftp://User@Adresse:Port/: Relative path resolved to "/home/User"
2023/06/13 21:11:50 DEBUG : sftp://User@Adresse:Port/: Using root directory "/home/User"
          -1 2023-05-28 05:48:24        -1 .cpanel
          -1 2018-05-15 11:23:14        -1 .cphorde
          -1 2016-08-16 07:39:42        -1 .htpasswds
          -1 2019-01-18 21:19:23        -1 .jbm
          -1 2017-01-14 20:06:12        -1 .pki
          -1 2017-09-28 04:54:30        -1 .softaculous
          -1 2018-05-15 09:42:34        -1 .spamassassin
          -1 2021-09-12 17:00:56        -1 .ssh
          -1 2016-11-10 00:47:36        -1 .subaccounts
          -1 2021-10-24 09:39:46        -1 22
          -1 2022-08-30 07:20:53        -1 24
          -1 2023-02-08 07:17:03        -1 25
          -1 2022-08-27 16:03:10        -1 51466546
          -1 2022-08-27 16:01:43        -1 6666666656
          -1 2022-08-26 07:15:43        -1 9528415
          -1 2021-09-12 17:15:42        -1 9bCEr6ckdM7xF3tGEFDYAac2
          -1 2023-06-13 19:41:31        -1 Unraid
          -1 2023-05-27 13:33:48        -1 access-logs
          -1 2017-04-19 14:41:01        -1 cache
          -1 2023-06-13 05:38:05        -1 data
          -1 2023-02-08 07:13:14        -1 etc
          -1 2017-02-28 14:19:38        -1 gallery
          -1 2021-09-19 17:18:23        -1 l1O0KxBluMkSxZ8uSWLZ2vIs
          -1 2023-05-27 13:33:52        -1 logs
          -1 2019-06-03 06:44:09        -1 mail
          -1 2021-09-12 16:45:45        -1 perl5
          -1 2018-12-09 22:59:44        -1 public_ftp
          -1 2023-05-26 13:23:14        -1 public_html
          -1 2023-05-27 03:42:35        -1 ssl
          -1 2023-02-08 07:13:36        -1 tmp
          -1 2016-08-16 07:40:46        -1 var
          -1 2017-06-09 21:41:19        -1 wp
          -1 2023-05-26 13:23:14        -1 www
2023/06/13 21:11:50 DEBUG : 11 go routines active
2023/06/13 21:11:50 DEBUG : sftp://User@Adresse:Port/: Closing 1 unused connections
/data # 
/data # rclone lsd NC-Remote: -vv
2023/06/13 21:20:34 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "lsd" "NC-Remote:" "-vv"]
2023/06/13 21:20:34 DEBUG : Creating backend with remote "NC-Remote:"
2023/06/13 21:20:34 DEBUG : Using config file from "/config/rclone/rclone.conf"
2023/06/13 21:20:34 DEBUG : Creating backend with remote "NC:/home/User/Unraid/Rclone"
2023/06/13 21:20:34 DEBUG : sftp://User@Adresse:Port//home/User/Unraid/Rclone: New connection IP:Port->IP:Port to "SSH-2.0-OpenSSH_7.4"
2023/06/13 21:20:34 DEBUG : sftp://User@Adresse:Port//home/User/Unraid/Rclone: Shell type "unix" from config
2023/06/13 21:20:34 DEBUG : sftp://User@Adresse:Port//home/User/Unraid/Rclone: Using root directory "/home/User/Unraid/Rclone"
2023/06/13 21:20:34 DEBUG : fs cache: renaming cache item "NC-Remote:" to be canonical "NC:/home/User/Unraid/Rclone"
          -1 2023-06-12 21:33:02        -1 006gtmgm0vkcfucsjqt2fjatbc
          -1 2023-06-12 21:33:02        -1 0anuode7gm88t10fmbnjhik0o4
          -1 2023-06-12 21:33:03        -1 3aa5i4c8d9g9f8mff49977akl8
          -1 2023-06-12 21:33:02        -1 7osvqdnv12luvnhk8ogrhtjjbc
          -1 2023-06-12 21:30:35        -1 Crypttest
          -1 2023-06-12 21:33:02        -1 kkht714r67bb9i08na3svlqq94
          -1 2023-06-12 21:33:03        -1 r64n8ckd1b9jjtesgsqbpl4qlc
          -1 2023-06-12 21:33:02        -1 rkuumd9glvdgqdldksdtuou6f8
          -1 2023-06-12 21:33:03        -1 slhninoscq2s30okk1u8ou3v6k
          -1 2023-06-12 21:33:02        -1 t042nm20hkd12p9fpckncjivf4
2023/06/13 21:20:34 DEBUG : 11 go routines active
2023/06/13 21:20:34 DEBUG : sftp://User@Adresse:Port//home/User/Unraid/Rclone: Closing 1 unused connections
/data # 

rclone config dump but make sure to redacted username/passwords/secrets/etc

about Crypttest, looks like a non-crypted folder inside a crypted remote.
are you sure that is correct?

/data # rclone config dump
{
    "NC": {
        "host": "host",
        "md5sum_command": "md5sum",
        "pass": "pass",
        "password": "password",
        "password2": "password2",
        "port": "port",
        "remote": "sftp:/home/User/Unraid/Rclone",
        "sha1sum_command": "sha1sum",
        "shell_type": "unix",
        "type": "sftp",
        "user": "user"
    },
    "NC-Crypt": {
        "password": "password",
        "password2": "password2",
        "remote": "NC:/home/User/Unraid/Rclone",
        "type": "crypt"
    },
    "NC-Remote": {
        "remote": "NC:/home/User/Unraid/Rclone",
        "type": "alias"
    }
}/data # 

For the Test yes.

that command worked, no errors, can you explain what the problem is?

The Problem is NC: have the wrong Path. He has through the Alias here Path or i understand the Alias Function wrong and that not changed for NC:?

with NC:. what is the exact full path you want to use for an alias?
make sure the output of rclone ls looks correct.

The Path of Remote is Name of the existing Config (NC) and the Folder Path (/home/User/Unraid/Rclone) correct? That is than NC:/home/User/Unraid/Rclone

Correct:

/data # rclone ls NC:/home/User/Unraid/Rclone
     5684 0pisupf50d9o4mgc9kg1civ69s
      760 300s9etuuru7gvv4fgh8du376o
      146 33uc7geuduikj64f3khrva7370
      253 3vmd4n2531r1hj86mo2knpumks
       55 5hp64dkukj3fc71uak6uo3s0fg
      126 6gffadu9u2fc3jd8svh0hpkdqc
      236 88fe7n9076j63vptof10fapgl4
      101 8agtc3appp2nn2hogqg7nmhisk
      470 ba03l9qu4donmpsefc6p6vhbo0
      223 eb7sqda66les9gj99l89dl3n4s
      332 f9i5nkdct69d9443nv92jl0q2o
    12861 fvjfccn19r0g8ommemfg4ru694
       61 hu4uk70gajgjpb7n3kg6sjfuvk
       86 ih2nao6ook9p1b81umaq0lj2l0
      102 iij2sv9pah2uc9k2mp6lavh7fk
      766 lqht2mse5i5s2kmgqn91cr0uss
      894 m91umtguc7nvnid9eqfs4ib6o8
      618 ncchhfaijcd0p5oqu1eldfmdgo
       63 nlhad5r790lili10pn2d0i16go
      498 o26u2h9t6i246c6gadfcnkm7nc
      281 qnrf9iisgb482s1jjv5cpjbhc0
      137 rgjsh7t4r54m8bsen2hf77f64s
     5602 s5psu6k41n153kgs603cnqcnshgba4l31cnut6auvmrnq8v104jg
     3192 tpe883di8p4bvf5us91gemg23s
     1220 v1hg6917refgbocpimaaqr02fc
     1274 vr9t1poviu6ldc1h1hbklg8pgg
      331 rkuumd9glvdgqdldksdtuou6f8/ua891nus0iut12kcu5dl202i3k
     2184 slhninoscq2s30okk1u8ou3v6k/15p89mapclcotbck9768cia7f0
     1593 slhninoscq2s30okk1u8ou3v6k/9nuhhs6jg3lq92em5amggt2mk4
      170 slhninoscq2s30okk1u8ou3v6k/dsmrropjiopd3cliv3mtov4v20
      139 slhninoscq2s30okk1u8ou3v6k/vv7ijkee1sn4qav4o67ocfph2k
      297 7osvqdnv12luvnhk8ogrhtjjbc/205in4impmsbaqia52vid8osl8
      495 7osvqdnv12luvnhk8ogrhtjjbc/kdbcr8mkuuvd8751iguvvhpen57jvu5u16g76u9iab7c8q8cqff0
      109 7osvqdnv12luvnhk8ogrhtjjbc/qv3ffi1gtau0k366qkb4kkq08o
      145 0anuode7gm88t10fmbnjhik0o4/flbc06662us9dacg0gr7eov3vg
      188 t042nm20hkd12p9fpckncjivf4/c8bv74aph1fa07qlc1ak61m67o
        7 Crypttest/alpine-release
     5554 Crypttest/ca-certificates.conf
       89 Crypttest/fstab
      233 Crypttest/fuse.conf
      718 Crypttest/group
      712 Crypttest/group-
       13 Crypttest/hostname
      175 Crypttest/hosts
      570 Crypttest/inittab
       54 Crypttest/issue
       15 Crypttest/modules
      284 Crypttest/motd
      205 Crypttest/nsswitch.conf
      188 Crypttest/os-release
     1226 Crypttest/passwd
     1172 Crypttest/passwd-
      846 Crypttest/profile
     3144 Crypttest/protocols
       78 Crypttest/resolv.conf
       98 Crypttest/securetty
    12813 Crypttest/services
      450 Crypttest/shadow
      422 Crypttest/shadow-
       38 Crypttest/shells
       53 Crypttest/sysctl.conf
     5636 Crypttest/udhcpd.conf
      140 Crypttest/logrotate.d/acpid
        7 Crypttest/apk/arch
      103 Crypttest/apk/repositories
       88 Crypttest/apk/world
      283 Crypttest/crontabs/root
      313 006gtmgm0vkcfucsjqt2fjatbc/f09p80muov08vt132psu9e7ul8/ne838bvelhfep1s8cakofe6fno
     1545 Crypttest/modprobe.d/aliases.conf
     2136 Crypttest/modprobe.d/blacklist.conf
      122 Crypttest/modprobe.d/i386.conf
       91 Crypttest/modprobe.d/kms.conf
       55 r64n8ckd1b9jjtesgsqbpl4qlc/hfeghl8bq41vdvbi6pbl46m4ek
      151 r64n8ckd1b9jjtesgsqbpl4qlc/ma6aqar6ooujqsg3p1399kb2p0
      136 r64n8ckd1b9jjtesgsqbpl4qlc/qke4qh8knjs5v4td1hhve42kf4
       97 Crypttest/secfixes.d/alpine
      249 Crypttest/profile.d/README
      447 Crypttest/profile.d/color_prompt.sh.disabled
       61 Crypttest/profile.d/locale.sh
       96 kkht714r67bb9i08na3svlqq94/9r9uo6dgmh66ch3is7ej2a1tvs/sbh7mmm3s01e9l8m5ksurr94ro
      265 Crypttest/network/if-up.d/dad
      848 r64n8ckd1b9jjtesgsqbpl4qlc/ep19pplgt1ctsueqrjp0192u2k/94d0ot25jeqv9gjcv1p713vt6gi7m9a3lavdf1acuvsm8kupkkt6h2cd04647j6j8kf30vsriccgj1erijgs7t3s72sqdqsm3c74aq8
      499 r64n8ckd1b9jjtesgsqbpl4qlc/ep19pplgt1ctsueqrjp0192u2k/edm8ioevgc1eh4hc8i8orvc6fpr1qi7bkppthlpk2vftb6kcgsidut1s0kopid1ia55djficokc3el63p5121ts7k81dpreihnn84c0
      848 r64n8ckd1b9jjtesgsqbpl4qlc/ep19pplgt1ctsueqrjp0192u2k/klpgr7se0m1vv26q8kmsobvk4m12bmsjjoneo2htiqj65jqqj9cib7u0v0u29jj1n42qogvapa9ieu6ogei2m4cb7cga6e78m7ll8h0
      499 r64n8ckd1b9jjtesgsqbpl4qlc/ep19pplgt1ctsueqrjp0192u2k/q82jak59d70etoptul0bu7da0cnu7kpuuhancol43k08tqpj812g8aitc5cpl1apr5l81kgb5rh6bqk7ld1sc1t28up1ee0jkn1g9uo
      499 r64n8ckd1b9jjtesgsqbpl4qlc/ep19pplgt1ctsueqrjp0192u2k/uspla73kcukoo0jjdv3n8ec3kj4a4sd2dmjfu6rds08k8o33ffeh4eshooaholsjdt3r0htia7pg8s8d9beg8mlpa0ajmkd7p35rc80
    12340 3aa5i4c8d9g9f8mff49977akl8/f27eg388v6ebe9ka6k469195oc
      460 3aa5i4c8d9g9f8mff49977akl8/kqpssngbhcpurinujpen8ct4u8
      460 3aa5i4c8d9g9f8mff49977akl8/lnabslfd3le8ipeia39cl70q55v1mivgt2joooo1v4ec2alu5log
    12340 3aa5i4c8d9g9f8mff49977akl8/oi2g99gk746cuv1pp90k8827ehka96v145103osalha6l7r75dog
      152 Crypttest/apk/protected_paths.d/ca-certificates.list
      451 Crypttest/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
      451 Crypttest/apk/keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
      451 Crypttest/apk/keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
      800 Crypttest/apk/keys/alpine-devel@lists.alpinelinux.org-6165ee59.rsa.pub
      800 Crypttest/apk/keys/alpine-devel@lists.alpinelinux.org-61666e3f.rsa.pub
      200 r64n8ckd1b9jjtesgsqbpl4qlc/relcpkq9t9abknnsrse90f8vu2jh3gn3p918rsqph44pmlr3htg0/mh6eab47i17feotfl9obu9p63f30bgepo209lqpf8mlli1betrd0
     6794 3aa5i4c8d9g9f8mff49977akl8/tqcg8t5bafv1rg2589p1c8jnok/1d5dqji5a9rf1kq5ae7c0bgcqo
     8110 3aa5i4c8d9g9f8mff49977akl8/tqcg8t5bafv1rg2589p1c8jnok/vt7dp3nb62283560r9r90jk2s0
   214318 3aa5i4c8d9g9f8mff49977akl8/o1ofn9u645kkrqmcprj38aepts/6t2lqjn5cqqmtc6foomf9ko28q7al6760let04ipn7c1tl296240
       48 Crypttest/ca-certificates/update.d/certhash
      412 Crypttest/ssl/ct_log_list.cnf
      412 Crypttest/ssl/ct_log_list.cnf.dist
    12292 Crypttest/ssl/openssl.cnf
    12292 Crypttest/ssl/openssl.cnf.dist
     8062 Crypttest/ssl/misc/CA.pl
     6746 Crypttest/ssl/misc/tsget.pl
   214222 Crypttest/ssl/certs/ca-certificates.crt
/data # 

ok

then use that with the alias remote.

Already use.

/data # rclone config
Current remotes:

Name                 Type
====                 ====
NC                   sftp
NC-Crypt             crypt
NC-Remote            alias

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> e

Select remote.
Choose a number from below, or type in an existing value.
 1 > NC
 2 > NC-Crypt
 3 > NC-Remote
remote> 3

Editing existing "NC-Remote" remote with options:
- type: alias
- remote: NC:/home/User/Unraid/Rclone

Option remote.
Remote or path to alias.
Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path".
Enter a string value. Press Enter for the default (NC:/home/User/Unraid/Rclone).
remote> 

Or i must used NC-Remote: and not NC:?

As I understood it, then the alias changes the path or suffers this for an existing Config on the desired path.

So the NC: now uses the NC remote path /home/User/Unraid/Rclone instead of /.

sorry, still not sure exactly what you want?
an alias remote is simple a shortcut, convenience factor.
there is no requirement to use it.

only you know the exact folder you want to use with the alias remote.

what is the exact folder you want to use with alias remote?
post the exact folder using the output of rclone lsd

need to post the output of a rclone command, that shows the exact folder

OK, then I misunderstood the alias function. I had hoped by this that one changes the start path of NC:. So that this is not the current path (/home/User) when calling NC:, but the one that is entered in NC-Remote: (/home/User/Unraid/Rclone) without entering NC-Remote:. This would ensure that no matter which Config/Remotes (NC/NC-Remote/NC-Crypt) is used, Rcone uses the same folder and has no access to the parent non-Rclone folder ... Has.

Or if the user should have a name. NC:/home/Max (The current path where you end up if you use NC:)
NC-Remote:/home/Max/Unraid/Rclone (The entered and desired path for NC:)

This is to long for the Commandline so i cant copy&paste the full output of this.

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