Can you use ProFTPD change location to external HDD?

Hello. I’m a little new to Linux. I want to be able to access and transfer files to my external HDD on my Windows PC, but I’m confused on which file servers I should use. ProFTPD is recommended, but I don’t know if there’s a way to change the location directory to be different drives. On the docs, they said to use “sed -i ‘/DefaultRoot /c\DefaultRoot /Path/To/Directory’ /etc/proftpd/proftpd.conf” and replace /Path/To/Directory, but that doesn’t seem to work. I might be doing it wrong?

Hi,

basically you have 3 options to access data on DietPi from Windows

  1. SCP
  2. FTP
  3. SAMBA

For SCP and FTP you would need a client tool on Windows, while SAMBA share can be mounted as network drive directly.

For FTP and SAMBA some additional server software and configuration would be needed, while SCP will work out of the box without any configuration. Only think needed to get SCP working would be OpenSSH Client (ID 0)

Pls can you share your FTP config file

cat /etc/proftpd/proftpd.conf
1 Like

Okay, thanks for the clarification. I’m guessing I change the “DefaultRoot /mnt/dietpi_userdata” with my external HDD? Here’s what my proftpd.conf:

# DietPi ProFTPD default config
# Location: /etc/proftpd/proftpd.conf
# Docs: http://www.proftpd.org/docs/directives/linked/configuration.html

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set "off" to disable IPv6 support which is problematic on IPv4 only boxes.
UseIPv6 on
# If set "on" you can experience a longer connection delay in many cases.
IdentLookups off
UseReverseDNS off

ServerName "DietPi FTP"
ServerType standalone
DeferWelcome off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

# Permit resuming downloads
AllowRetrieveRestart On
# Permit resuming uploads
AllowStoreRestart On
TimeoutNoTransfer 120
TimeoutStalled 120
TimeoutIdle 240
DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions "-l"

DenyFilter \*.*/

DefaultRoot /mnt/dietpi_userdata

Port 21
MaxInstances 8

RootLogin off
User dietpi
Group dietpi
Umask 002 002
AllowOverwrite on

TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log
# Stop /var/log/wtmp logging: No such file or directory -Gordon Williams change
WtmpLog off
# /var/log/lastlog logging
#UseLastlog on

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>

<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine off
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#Include /etc/proftpd/tls.conf

# Include other custom configuration files
Include /etc/proftpd/conf.d/

Hi,

your config file still contains default value.

DefaultRoot /mnt/dietpi_userdata

This would need to be changed to point to your HDD and you already posted the way how to do on your first post

systemctl stop proftpd
sed -i '/DefaultRoot /c\DefaultRoot /Path/To/Directory' /etc/proftpd/proftpd.conf
systemctl start proftpd

/Path/To/Directory would need to be replaced and I guess your HDD will be located somewhere in /mnt/something

That seemed to work. I used WinSCP. I tried putting a test file through, and it says permission denied. Did something go wrong?

I have a few more questions if you don’t mind. Whenever I have my external HDD mounted, the light on the enclosure blinks constantly. I believe the light is supposed to indicate its reading/writing to the HDD inside but constant blinking seems strange. My second question is the light on my pi itself. This doesn’t necessarily have to do with DietPi itself but, whenever I boot from an m.2 SSD (no SD card inserted), I have a solid green light that blinks roughly every 10 seconds. To my knowledge, the green light is SD card activity. Do you know why it could be doing this?

Thank you so much for the amazing work you and your team have done. This is my all-time favorite OS for the Raspberry Pi.

Let me try to answer your questions one by one

I used WinSCP. I tried putting a test file through, and it says permission denied. Did something go wrong?

Which user you used to login?

Whenever I have my external HDD mounted, the light on the enclosure blinks constantly

Sorry I don’t know. Not sure how your enclosure is supposed to work. Probably you could check with the vendor

I boot from an m.2 SSD (no SD card inserted), I have a solid green light that blinks roughly every 10 seconds

I guess the system is trying to check for the availability of a SD card on regular basis. To manage your LED, DietPi is offering a tool dietpi-led_control. There you could manage the led setting and have it deactivated. Personally I set following on my RPi

  1. led0 - Act > panic
  2. led1 - Power > none

Thanks!

Which user you used to login?

I was using the user “dietpi”. It doesn’t allow me to log in through “root”. I changed “RootLogin off” to on and that seemed to fix it. I can now transfer files. Is there something else I need to change in the .conf?

usually not. For further config options you can have a look to official ProFTP docs http://www.proftpd.org/docs/

Alright. Thank you so much!