termux-packages icon indicating copy to clipboard operation
termux-packages copied to clipboard

Pure-ftpd puredb error

Open nodefive opened this issue 4 years ago • 3 comments

PureDB can't be read

When using puredb auth method the daemon fails to login with a:

421 Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb

Tried using a config file and using the command line with the proper flags. Both fail with the message above.

Steps to reproduce

Install pure-ftpd: apt install pure-ftpd

/data/data/com.termux/files/usr/etc/pure-ftpd.conf:

ChrootEveryone               no
BrokenClientsCompatibility   no
MaxClientsNumber             10
Daemonize                    yes
MaxClientsPerIP              10
DisplayDotFiles              yes
AnonymousOnly                no
NoAnonymous                  yes
AnonymousCanCreateDirs       no
VerboseLog                   no
SyslogFacility               ftp
DontResolve                  yes
MaxIdleTime                  15
PureDB                       /data/data/com.termux/files/usr/etc/pureftpd.pdb
UnixAuthentication           no
LimitRecursion               10000 8
MaxLoad                      4
PassivePortRange             30000 50000
ForcePassiveIP               192.168.1.50
AntiWarez                    no
Bind                         192.168.1.50,21
Umask                        133:022
MinUID                       14
AllowUserFXP                 no
AllowAnonymousFXP            no
ProhibitDotFilesWrite        no
ProhibitDotFilesRead         no
AutoRename                   no
AnonymousCantUpload          no
PIDFile                      /data/data/com.termux/files/usr/var/run/pure-ftpd.pid
MaxDiskUsage                 99
CustomerProof                yes
IPV4Only                     yes
TLS                          1
TLSCipherSuite               HIGH
CertFile                     /data/data/com.termux/files/usr/etc/pure-ftpd.pem

Setup userdb:

touch /data/data/com.termux/files/usr/etc/pureftpd.passwd
pure-pw useradd droid -u u0_a156 -D /data/data/com.termux/files/home/ -m

-m updates the db. But to make sure:

pure-pw mkdb /data/data/com.termux/files/usr/etc/pureftpd.pdb

I've tried...

executing as root with: sudo pure-ftpd /data/data/com.termux/files/usr/etc/pure-ftpd.conf

executing as root with:

tsu
pure-ftpd /data/data/com.termux/files/usr/etc/pure-ftpd.conf

executing as user on a higher port with: pure-ftpd /data/data/com.termux/files/usr/etc/pure-ftpd.conf

chmoding the db file to 664 chmod 644 /data/data/com.termux/files/usr/etc/pureftpd.pdb

mounting /system/etc as rw and placing the db there:

sudo mount -o rw,remount /system
sudo cp /data/data/com.termux/files/usr/etc/pureftpd.pdb /etc

and just to make sure:

sudo mkdir /etc/pure-ftpd
sudo cp /data/data/com.termux/files/usr/etc/pureftpd.pdb /etc/pure-ftpd/

Nothing works, in the end I get a:

421 Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb

nodefive avatar Jun 29 '20 01:06 nodefive

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 18 '21 18:11 stale[bot]

Please share the termux-info output.

xtkoba avatar Dec 25 '22 14:12 xtkoba

I have the same problem, I would like to solve it. I've been working on this for a couple of days now. I don't know if it's a problem in setting UID and GID, password encryption (in the pure-pw program) or a compilation error. Namely, there is an old application FTPDroid that uses "pure-ftpd v1.0.32", and in which everything works fine. It is compiled with NDK - jni. Does anyone know anything more about how to create FTP users and where the error is.

Bokili-2022 avatar Dec 30 '22 18:12 Bokili-2022

Again, please share your termux-info output. This does not reproduce for me.

xtkoba avatar Mar 02 '23 09:03 xtkoba

I haven't solved the problem with the termux compilation of pure-ftpd. I'm using an older version compiled into the Android NDK, and I think the problem is user authentication. This compilation supports "$1$" (MD5 encryption), while in the newer - Termux version of pure-ftpd only SHA512 is supported, for which I did not have the necessary modules (libraries) installed. That's probably my problem too. With Termux, everything is linked to external plugins, and it's hard to use anything as a stand-alone program.

Bokili-2022 avatar Mar 02 '23 11:03 Bokili-2022

So this is not our issue.

xtkoba avatar Mar 02 '23 11:03 xtkoba

I guess you're right. Thank you. Greetings.

Bokili-2022 avatar Mar 02 '23 12:03 Bokili-2022