You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure the SQL and SFTP module and try to access the homedir, which gets returned from the SQL module / query when authenticating a user.
What I Expected/Wanted
I would like to use the returned values of the SQL query in form of variables in the SFTP configuration.
Example:
# /etc/proftpd/conf.d/sql.conf <IfModule mod_sql.c>
SQLBackend mysql
SQLPasswordEngine on
SQLEngine on
SQLPasswordEncoding hex
SQLAuthenticate users
SQLAuthTypes Crypt
SQLConnectInfo database_name@database_host:3306 db_user db_pass
SQLUserInfo webdav_user user_name password user_id gid homedir shell
</IfModule>
The above SQL configuration returns a homedir, which I need for the SFTP pubkey configuration:
# /etc/proftpd/conf.d/sftp.conf<IfModule mod_sftp.c><VirtualHost 0.0.0.0>
SFTPEngine on
Port 2223
Include /etc/proftpd/conf.d/sql.conf
SFTPAuthMethods password publickey
RequireValidShell off
SFTPAuthorizedUserKeys file:/nfs/%{env:sql.homedir}/.ssh/authorized_keys
...
</VirtualHost></IfModule>
%u is here unfortunately not sufficient as the entire folder structure can be very dynamic, so it does not only the username differ in the path.
Hmm. I'll take a look to see if this can be done simply -- it may not.
My first thought was that you might consider using mod_sftp_sql, such that the SFTP public keys are also stored in your SQL database, rather than on the filesystem (NFS-mounted or otherwise).
If you are looking to have more of your ProFTPD configured obtained from a SQL database, you might also look into https://github.com/Castaglia/proftpd-mod_conf_sql Although that module is more for pulling the entire ProFTPD configuration, at startup time, from a SQL database, rather than querying for only user-specific portions of configuration from a SQL database in the middle of some session.
What I Did
Configure the SQL and SFTP module and try to access the
homedir
, which gets returned from the SQL module / query when authenticating a user.What I Expected/Wanted
I would like to use the returned values of the SQL query in form of variables in the SFTP configuration.
Example:
The above SQL configuration returns a
homedir
, which I need for the SFTP pubkey configuration:%u
is here unfortunately not sufficient as the entire folder structure can be very dynamic, so it does not only the username differ in the path.ProFTPD Version and Configuration
The text was updated successfully, but these errors were encountered: