![]() |
|
OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Lately I've been trying to set up pure-ftpd with virtual user support in MariaDB and hashed scrypt passwords. Has anyone else achieved this?
I hash the passwords in python 3.5 using the libsodium bindings (pysodium) as per instructed from the README.MySQL file (https://download.pureftpd.org/pub/pu...c/README.MySQL <- read the SCRYPT part). I then store the hashed password in my users table, ie. "$7$C6..../....YzvCLmJDYJpH76BxlZB9fCpCEj2AbGQHoLiG9I/VRO1$/enQ.o1BNtmxjxNc/8hbZq8W0JAqR5YpufJXGAdzmf3". However, I still get a 503 authentication failed response and syslogd does not really give any indication on where the fault lies. I've also enabled query logging to check wether pure-ftpd actually does it correct, and so far it looks good. Any takes on what I could be doing wrong? |
|
|||
![]()
Much obliged!
I have actually not seen that in the docs. Good pointer! However, I usually define a default MySQL UID and GID (based on the values of the system user _mysql) in my pureftpd-mysql.conf file. Quote:
|
|
||||
![]() Quote:
It's possible to use scrypt to encrypt passwords, but in the configuration file, MYSQLCrypt must be defined as crypt.
__________________
ThinkPad W500 P8700 6GB HD3650 - faultry ThinkStation P700 2x2695v3 32GB 1050ti 3xSSD 1xHDD |
|
|||
![]() Quote:
Quote:
Last edited by anigma; 18th January 2017 at 05:20 PM. |
|
|||
![]()
I managed to get it working now after a lot of debugging. For those of you that are struggling with the same, I have a couple of pointers.
1) Use the pysodium module with Python 2.x (NOT 3.x) to generate the hashed scrypt passwords. Pure-FTPd does not seem to support the format of the 3.x version. ie. Code:
[root@jigsaw ~]# python2.7 Python 2.7.12 (default, Jul 25 2016, 16:14:54) [GCC 4.2.1 20070719 ] on openbsd6 Type "help", "copyright", "credits" or "license" for more information. >>> import pysodium >>> pysodium.crypto_pwhash_scryptsalsa208sha256_str('test', 1, 1) '$7$/6.....6...jrxPc5U3f.gs28B7PBIWiQMdhREp2DSIyzH4I57pEF8$FVo7.JGG0/4GK8dahDn7SVdoOBllHgGMCVOoIs/6tM.' Here is my current pureftpd-mysql.conf: Code:
#MYSQLServer localhost #MYSQLPort 3306 MYSQLSocket /var/www/var/run/mysql/mysql.sock MYSQLUser root MYSQLPassword <password> MYSQLDatabase pureftpd MYSQLCrypt scrypt MYSQLGetPW SELECT Password FROM users WHERE Username = '\L' AND Status = '1' MYSQLGetDir SELECT Directory FROM users WHERE Username = '\L' AND Status = '1' MYSQLDefaultUID 642 MYSQLDefaultGID 642 #MYSQLGetUID SELECT UID FROM users WHERE Username = '\L' #MYSQLGetGID SELECT GID FROM users WHERE Username = '\L' Code:
[root@jigsaw ~]# rcctl get pure_ftpd pure_ftpd_class=daemon pure_ftpd_flags=-A -B -d -H -j -l mysql:/etc/pureftpd-mysql.conf -Y 2 pure_ftpd_rtable=0 pure_ftpd_timeout=30 pure_ftpd_user=root |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenBSD ftpd FTP/TLS | FrankieKat | OpenBSD Security | 3 | 21st November 2013 12:09 AM |
New tool on the block - scrypt | s0xxx | FreeBSD Security | 2 | 21st May 2009 07:48 AM |
Running Pure 64-Bits On FreeBSD. | MetalHead | FreeBSD General | 4 | 21st October 2008 04:59 AM |
ftpd problem | narcotico | FreeBSD General | 3 | 11th July 2008 03:08 AM |
pure-ftpd | hirohitosan | FreeBSD Ports and Packages | 3 | 10th June 2008 06:31 PM |