Possible to FTP to DietPi and get to /mnt?

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Possible to FTP to DietPi and get to /mnt?

Post by Joulinar »

pls share

Code: Select all

ls -la /mnt/dietpi_userdata/Plex/Movies
ls -la /mnt/External/Movies/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
AJRobson
Posts: 48
Joined: Fri Jan 08, 2021 2:23 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by AJRobson »

Code: Select all

root@DietPi:/mnt/External# ls -la /mnt/dietpi_userdata/Plex/Movies
total 128
drwxrwxrwx 31 dietpi dietpi 4096 Mar 16 21:57  .
drwxrwxrwx  5 root   root   4096 Mar 16 16:43  ..
-rw-rw-r--  1 dietpi dietpi  118 Mar 16 21:21  .zshrc
drwxrwx---  2 dietpi dietpi 4096 Mar 15 14:31 'Baby Done (2021)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 30 11:30 'Bedazzled (1967)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 26 00:37 'Bedazzled (2000)'
drwxrwx---  2 dietpi dietpi 4096 Mar 11 22:03 'Buried (2010)'
drwxrwx---  2 dietpi dietpi 4096 Mar 12 20:35 'Cherry (2021)'
drwxrwx---  2 dietpi dietpi 4096 Mar  7 00:40 'Contagion (2011)'
drwxrwxr-x  2 dietpi dietpi 4096 Nov 11 21:26 'Death to Smoochy (2002)'
drwxrwxr-x  2 dietpi dietpi 4096 Mar 12 22:04 'Drive (2011)'
drwxrwx---  2 dietpi dietpi 4096 Mar 11 21:23 'Enron The Smartest Guys In The Room (2005)'
drwxrwxr-x  2 dietpi dietpi 4096 Dec 24 10:38 'Freeze Frame (2004)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan  6 22:43 'Hall Pass (2011)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan  7 02:50 'Human Traffic (1999)'
drwxrwx---  2 dietpi dietpi 4096 Mar 11 22:04 'I Am Ali (2014)'
drwxrwx---  2 dietpi dietpi 4096 Mar 11 22:04 'Kurt Cobain Montage of Heck (2015)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 26 17:35 'Resident Evil (2002)'
drwxrwxr-x  2 dietpi dietpi 4096 Feb  5 02:00 'Resident Evil Damnation (2012)'
drwxrwxr-x  2 dietpi dietpi 4096 Feb 15 18:02 'Royal Family (1969)'
drwxrwx---  2 dietpi dietpi 4096 Mar 12 20:35 'SAS Red Notice (2021)'
drwxrwx---  2 dietpi dietpi 4096 Mar  7 00:31 'Stars fell on Alabama (2021)'
drwxrwxr-x  2 dietpi dietpi 4096 Mar 11 23:11 'The Inbetweeners 2 (2014)'
drwxrwxr-x  2 dietpi dietpi 4096 Mar 11 23:10 'The Inbetweeners Movie (2011)'
drwxrwxr-x  2 dietpi dietpi 4096 Feb 20 16:56 'The Owners (2020)'
drwxrwx---  2 dietpi dietpi 4096 Mar 12 20:35 'The Vault (2021)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 27 14:56 'Ultraviolet (2006)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 27 14:56 'Underworld (2003)'
drwxrwxr-x  2 dietpi dietpi 4096 Feb  8 00:12 'Vice (2018)'
drwxrwx---  2 dietpi dietpi 4096 Mar 12 20:36 'Way Down (2021)'
drwxrwxr-x  2 dietpi dietpi 4096 Jan 26 17:20 'Young Adult (2011)'
drwxrwxr-x  2 dietpi dietpi 4096 Mar 16 21:36  demo

Code: Select all

root@DietPi:/mnt/External# ls -la /mnt/External/Movies/
total 5
drwxrwxrwx 1 dietpi dietpi  568 Mar 16 21:59  .
drwxrwxrwx 1 dietpi dietpi 4096 Mar 16 20:35  ..
drwxrwxrwx 1 dietpi dietpi  240 Mar 12 07:50 'A Royal Night Out (2015)'
drwxrwxrwx 1 dietpi dietpi  176 Feb 14 01:53 'Stay Tuned (1992)'
drwxrwxrwx 1 dietpi dietpi  232 Feb 16 15:04 'The Fighter (2010)'
drwxrwxrwx 1 dietpi dietpi  240 Dec  6 15:38 'The Sugarland Express (1974)'
drwxrwxr-x 1 dietpi dietpi    0 Mar 16 21:36  demo
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Possible to FTP to DietPi and get to /mnt?

Post by Joulinar »

ok I guess I got it. At least I'm able to reproduce same error message 550 Rename

Code: Select all

. 2021-03-16 23:15:30.546 Moving file "demo" to "/usb/demo/demo".
> 2021-03-16 23:15:30.546 RNFR /dietpi_userdata/downloads/demo
< 2021-03-16 23:15:30.546 350 File or directory exists, ready for destination name
> 2021-03-16 23:15:30.546 RNTO /usb/demo/demo
< 2021-03-16 23:15:30.561 550 Rename /usb/demo/demo: Is a directory
. 2021-03-16 23:15:30.561 Asking user:
. 2021-03-16 23:15:30.561 Error moving file 'demo' to '/usb/demo/demo'. ("Rename /usb/demo/demo: Is a directory")
Looks like it is not possible to move directories using FTP. Probably you would need to use SAMAB or SCP

For me SCP is working fine. This is the output

Code: Select all

. 2021-03-16 23:19:38.101 Listing current directory.
> 2021-03-16 23:19:38.101 ls -la --full-time ; echo "WinSCP: this is end-of-file:$?"
< 2021-03-16 23:19:38.101 total 16
< 2021-03-16 23:19:38.101 drwxrwxr-x 4 dietpi dietpi 4096 2021-03-16 23:19:39.389050514 +0100 .
< 2021-03-16 23:19:38.101 drwxrwxr-x 8 dietpi dietpi 4096 2021-03-14 11:26:51.869668226 +0100 ..
< 2021-03-16 23:19:38.101 drwxrwxr-x 2 dietpi dietpi 4096 2021-03-16 23:09:50.679050739 +0100 The Inbetweeners Movie (2011)
< 2021-03-16 23:19:38.101 drwxrwxr-x 2 dietpi dietpi 4096 2021-03-16 23:15:17.569050614 +0100 demo.scp
< 2021-03-16 23:19:38.101 WinSCP: this is end-of-file:0
. 2021-03-16 23:19:38.101 ..;d;0;2021-03-14T10:26:51.000Z;3;"dietpi" [0];"dietpi" [0];rwxrwxr-x;0
. 2021-03-16 23:19:38.101 The Inbetweeners Movie (2011);d;0;2021-03-16T22:09:50.000Z;3;"dietpi" [0];"dietpi" [0];rwxrwxr-x;0
. 2021-03-16 23:19:38.101 demo.scp;d;0;2021-03-16T22:15:17.000Z;3;"dietpi" [0];"dietpi" [0];rwxrwxr-x;0
. 2021-03-16 23:19:46.932 Moving file "demo.scp" to "/mnt/usb/demo.scp".
> 2021-03-16 23:19:46.932 mv -f "demo.scp" "/mnt/usb/demo.scp" ; echo "WinSCP: this is end-of-file:$?"
< 2021-03-16 23:19:46.932 WinSCP: this is end-of-file:0
. 2021-03-16 23:19:46.948 Listing current directory.
> 2021-03-16 23:19:46.948 ls -la --full-time ; echo "WinSCP: this is end-of-file:$?"
< 2021-03-16 23:19:46.948 total 12
< 2021-03-16 23:19:46.948 drwxrwxr-x 3 dietpi dietpi 4096 2021-03-16 23:19:48.239050511 +0100 .
< 2021-03-16 23:19:46.948 drwxrwxr-x 8 dietpi dietpi 4096 2021-03-14 11:26:51.869668226 +0100 ..
< 2021-03-16 23:19:46.948 drwxrwxr-x 2 dietpi dietpi 4096 2021-03-16 23:09:50.679050739 +0100 The Inbetweeners Movie (2011)
< 2021-03-16 23:19:46.948 WinSCP: this is end-of-file:0
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
AJRobson
Posts: 48
Joined: Fri Jan 08, 2021 2:23 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by AJRobson »

Thanks for looking into for me, I'll take a look at using SCP in the morning and see how it goes.
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Possible to FTP to DietPi and get to /mnt?

Post by Joulinar »

you would need to install OpenSSH Client (software ID 0) if you like to use SCP
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 340
Joined: Tue Feb 25, 2020 2:54 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by trendy »

SCP works with the default dropbear or openssh-server. There is no need to install the client.
User avatar
Joulinar
Posts: 5087
Joined: Sat Nov 16, 2019 12:49 am

Re: Possible to FTP to DietPi and get to /mnt?

Post by Joulinar »

well not fully correct. @trendy. Yes you can connect using SCP but you are not able to transfer files because you are missing the SCP executable. In theory it's possible to copy this single file in place, but more easier to install OpenSSH Client ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 3087
Joined: Sat Nov 18, 2017 6:21 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by MichaIng »

SCP is part of the openssh-client package and SFTP is part of the openssh-sftp-server package, so indeed openssh-server itself is not required.

There is an alternative SFTP server: https://packages.debian.org/buster/gesftpserver
I use this on my systems with Dropbear, it seems lighter than OpenSSH's SFTP. But it does not ship the executable as /usr/lib/sftp-server. In WinSCP it can be manually changed, but for other SFTP clients a symlink does the job.
User avatar
trendy
Posts: 340
Joined: Tue Feb 25, 2020 2:54 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by trendy »

Joulinar wrote: Thu Mar 18, 2021 1:15 pm well not fully correct. @trendy. Yes you can connect using SCP but you are not able to transfer files because you are missing the SCP executable. In theory it's possible to copy this single file in place, but more easier to install OpenSSH Client ;)
Nope, it is fully correct. I have only dropbear running on one dietpi and only openssh-server on anoter, no openssh-client on either of them.
I just connected via scp and copied a file on both.
If you are not going to initiate the connection from the dietpi, then the openssh-client is not needed.
User avatar
MichaIng
Site Admin
Posts: 3087
Joined: Sat Nov 18, 2017 6:21 pm

Re: Possible to FTP to DietPi and get to /mnt?

Post by MichaIng »

Interesting. I also thought the scp binary is required on both devices, similarly how the sftp-server binary is required on the target/server device. Probably something changed in Dropbear, serving it internally? Good to know when we want to add SFTP and SCP as install options in combination with Dropbear.
Post Reply