apt-get install proftpd proftpd-mod-mysql
Create Group & User
Run the following command:
Then run the following query:
We will first modify the /usr/local/ispconfig/interface/lib/config.inc.php file:
Find the variable db_password and password note for later.
Edit the file /etc/proftpd/proftpd.conf :
Find to line:
Remove the caption for it to become:
Edit the file /etc/proftpd/sql.conf :
Delete all content in it and replace it with:
# # Proftpd sample configuration for SQL-based authentication. # # (This không phải được sử dụng nếu bạn muốn xác thực PAM-based) # DefaultRoot ~ SQLBackend mysql # The passwords printed MySQL are encrypted using CRYPT SQLAuthTypes Plaintext Crypt SQLAuthenticate users # used to connect to the database # databasename users group database_user user_password SQLConnectInfo dbispconfig @ localhost ispconfig _insertpasswordhere_ # Here we tell ProFTPd the names of the database columns in the "usertable" # we want it to interact with. Đã có các tên với các người dùng trong cơ sở dữ liệu dbUser trong sqp_user username password uid gid dir shell # Here we tell ProFTPd the names of the database columns in the "grouptable" # we want it to interact with. Again các tên với các cùng trong cơ sở dữ liệu SQLGroupInfo ftp_group groupname gid members # set min UID and GID - otherwise these are 999 each SQLMinID 500 # create a directory user on demand if it doesn't exist CreateHome off # Update count every time logs in SQLLog PASS updatecount SQLNamedQuery updatecount UPDATE "count = count + 1, accessed = now () WHERE userid = '% u'" ftpuser # Update modified everytime user uploads or deletes a file SQLLog STOR, DELE modified SQLNamedQuery modified UPDATE, DELE modified SQLNamedQuery modified UPDATE "modified = now () WHERE userid = '% u' "ftpuser RootLogin off RequireValidShell off
Make sure you have changed _insertpasswordhere_ with a password from ISPConfig.
If the MySQL database is on another server, change localhost to represent your MySQL server.
Edit the file /etc/proftpd/modules.conf :
Find to line:
and uncomment it to:
Change the line:
City:
Finally run:
Now we need to change some files in ispconfig. Although this is not the best idea because when upgrading to the new version, these changes will disappear. However, in this case, ProFTPD will work better.
Edit the file /usr/local/ispconfig/interface/web/sites/ftp_user_edit.php :
Find the line:
and replace with:
It is done! Note that if you are logged into the ISPConfig web console, you must log out before changing the registrations on your computer.