I'd like to link some of MODX users with FTP server users on a Linux host.
FTP account password should be updated on password change in MODX. The user profile would contain some info for FTP account configuration, like home directory or allowed paths etc.
How could this be achieved? Did anyone do this already? What FTP server for Linux (Ubuntu/Debian) would fit best?
Any suggestions are welcome.
This is the web: the only thing you know about who will come is that you don't know who will come.
Quote from: opengeek at Sep 08, 2011, 12:49 PMThe security risks involved are non-trivial.
Certainly they are, as far as shell accounts are involved. However, virtual FTP users managed in database do not. And that's what I've thought about. I've found that at least PureFTPd and ProFTP both support managing users in MySQL.
The integration plugin should then update FTP user tables on MODX user update. I guess this involves some XPDO work on mapping those tables, which has not been in my scope yet.
Could you outline what should it work like?
This is the web: the only thing you know about who will come is that you don't know who will come.
-
☆ A M B ☆
- 24,524 Posts
So if I understand correctly, you are not trying to create ftp users, you want to update existing user data when a corresponding MODx user is updated. How to do this would depend on how your server handles the ftp user accounts. If this is your own server, then you should be able to configure the ftp server to store the user account in such a way that a plugin (onSave...) would be able to update the ftp user account.
It does look like ProFTPD's virtual user system would best support what you want to try to do. Keep in mind that the user still has to be defined in the server's etc/passwd, and the UID and GID of the user must match. But you should be able to store the rest of the user's data in the database, and access it directly from your MODx plugin.
Quote from: sottwell at Sep 09, 2011, 07:02 AMSo if I understand correctly, you are not trying to create ftp users, you want to update existing user data when a corresponding MODx user is updated.
Sort of. I want to be able to define FTP parameters (home directory, quota, etc.) in MODX user profile and get them updated (or created or deleted if neccessary) on user update.
It does look like ProFTPD's virtual user system would best support what you want to try to do. Keep in mind that the user still has to be defined in the server's etc/passwd, and the UID and GID of the user must match. But you should be able to store the rest of the user's data in the database, and access it directly from your MODx plugin.
I'm running a dedicated VPS so can do what I want. I think I'm going to use PureFTPd, which doesn't require any system users. Just a pure virtual pool of accounts stored in MySQL and only one system account for the server itself (it doesn't even require root), which simplifies the task greatly. The most important part for me is to have users manage their password in one place.
Another option would be to use LDAP authentication for both FTP (it's possible with PureFTPd) and MODX (is it possible?).
I'm definitely going to give it a try.
This is the web: the only thing you know about who will come is that you don't know who will come.
-
MODX Staff
- 10,725 Posts
You can extend modUser to not require a password to be stored at all. This way, you can authenticate against the FTP accounts in MySQL using a custom plugin and not have to worry about sync'ing password changes bi-directionally. You can manage them in ProFTPd and simply add records with the username and other data you need in MODX.