1

I just set up my ftp server with proftpd and mod_sql. Authentication seemed to work fine until now. I can still log in with the users in the database but the chroot doesnt work anymore. Instead of taking the homedir from the database, the server tries to chroot me to the default homedir (which isn't possible, because it's set to /dev/null).

proftpd.log:

2016-10-25 18:12:21,276 xxx proftpd[2673] xxx.de (xxx.t-ipconnect.de[80.128.XX.XX]): FTP session opened.

2016-10-25 18:12:21,313 xxx proftpd[2673] xxx.de (xxx.t-ipconnect.de[80.128.XX.XX]): chroot to '/dev/null' failed for user 'me': Not a directory

2016-10-25 18:12:21,313 xxx proftpd[2673] xxx.de (xxx.t-ipconnect.de[80.128.XX.XX]): error: unable to set DefaultRoot directory

2016-10-25 18:12:21,313 xxx proftpd[2673] xxx.de (xxx.t-ipconnect.de[80.128.XX.XX]): FTP session closed.

proftpd/sql.conf

SQLConnectInfo froxlor@127.0.0.1 froxlor ******
SQLUserInfo ftp_users username password uid gid homedir shell
SQLGroupInfo ftp_groups groupname gid members
SQLUserWhereClause "login_enabled = 'y'"

SQLLog PASS login
SQLNamedQuery login UPDATE "last_login=now(), login_count=login_count+1 WHERE username='%u'" ftp_users

SQLLog RETR download
SQLNamedQuery download UPDATE "down_count=down_count+1, down_bytes=down_bytes+%b WHERE username='%u'" ftp_users

SQLLog STOR upload
SQLNamedQuery upload UPDATE "up_count=up_count+1, up_bytes=up_bytes+%b WHERE username='%u'" ftp_users

Any idea on how to resolve this?

  • What version of ProFTPD are you using? What home directory do you have configured, for that user, in your SQL table? If `/dev/null` is your home directory, then you *must* provide a valid (and usable!) directory, so that the `chroot()` functions properly. You _cannot_ use `DefaultRoot` without a valid and usable directory. – Castaglia Oct 26 '16 at 16:04

0 Answers0