From 06653ab77c50e249c44e7bec82b24ff5fe3184b4 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 29 Aug 2025 22:30:06 +0500 Subject: [PATCH] ubuntu 24 ftp fix --- install/install.py | 13 +++++++++++++ plogical/ftpUtilities.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/install/install.py b/install/install.py index 394eb6797..8e53e3f0c 100644 --- a/install/install.py +++ b/install/install.py @@ -2591,6 +2591,19 @@ vmail # Start Pure-FTPd if it was installed if os.path.exists('/home/cyberpanel/pureftpd'): + # Configure Pure-FTPd for Ubuntu 24.04 (SHA512 password hashing compatibility) + if self.distro == ubuntu: + import install_utils + try: + release = install_utils.get_Ubuntu_release(use_print=False, exit_on_error=False) + if release and release >= 24.04: + preFlightsChecks.stdOut("Configuring Pure-FTPd for Ubuntu 24.04...") + # Change MYSQLCrypt from md5 to crypt for SHA512 compatibility + command = "sed -i 's/MYSQLCrypt md5/MYSQLCrypt crypt/g' /etc/pure-ftpd/db/mysql.conf" + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + except: + pass # If version detection fails, continue without configuration change + preFlightsChecks.stdOut("Starting Pure-FTPd service...") ftpService = self.pureFTPDServiceName(self.distro) command = f'systemctl start {ftpService}' diff --git a/plogical/ftpUtilities.py b/plogical/ftpUtilities.py index 85eccb1f9..178d295a4 100644 --- a/plogical/ftpUtilities.py +++ b/plogical/ftpUtilities.py @@ -204,7 +204,7 @@ class FTPUtilities: def changeFTPPassword(userName, password): try: ProcessUtilities.decideDistro() - if ProcessUtilities.ubuntu22Check == 1: + if ProcessUtilities.ubuntu22Check == 1 or ProcessUtilities.alma9check: from crypt import crypt, METHOD_SHA512 FTPPass = crypt(password, METHOD_SHA512) else: