Add to Favourites Add to Favourites    Print this Article Print this Article

I need to use UTF-8 for FTP

FTP is natively a very old protocol, so UTF-8 is rarely enabled by default in most cases.
If you want pure-ftpd to support characters in the paths, you must recomipled pure-ftp and add a few extra startup options.

1) Change the configure options for pure-ftp wth the "--with-rfc2640" option:

cd /usr/local/directadmin/custombuild
mkdir -p custom
cp -Rp configure/pureftpd custom
nano custom/pureftpd/configure.pureftpd

add the option --with-rfc2640 to the bottom, making the file look like this:

#!/bin/sh
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--with-certfile=/etc/pure-ftpd.pem \
--with-tls \
--with-puredb \
--with-quotas \
--with-altlog \
--with-ftpwho \
--with-ratios \
--with-welcomemsg \
--with-rfc2640

note the extra \ character, added to the --with-welcomemsg line.

2) Recompile pure-ftp:

cd /usr/local/directadmin/custombuild
./build pureftpd


3)

Update: Jan 2018

New installs will have

/etc/pure-ftpd.conf

so changes can be added there, instead of in the boot script.
Edit the /etc/init.d/pure-ftpd boot script, to add 2 new options:

--fscharset=utf-8 --clientcharset=utf-8

you can basically insert them into an already existing OPTIONS line, or add your own, eg:

OPTIONS="-B -A -C 15 -E -H -k 99 -L 10000:8 -O stats:${LOG} -l puredb:${DB} -p 35000:35999 -u 100 -U 133:022 -w -Z"
OPTIONS="${OPTIONS} -Y 1 -J HIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3"
OPTIONS="${OPTIONS} --fscharset=utf-8 --clientcharset=utf-8"


4) Restart pure-ftpd:

service pure-ftpd restart




Was this answer helpful?

Also Read