Plesk

Unable to change FTP user password for a Subscription in Plesk: usermng: PAM password change failed

Symptoms

Cause

The system user was deleted from the operating system but exists in the Plesk database.

Resolution

  1. Connect to the server using SSH.

  2. Re-create FTP user(s) using data from Plesk database:

    • For a single missing user run the following command. (where john_doe is replaced by the missing system user from the errors):

      # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"select s.login, a.password, s.home, s.shell from sys_users s, accounts a where a.id = s.account_id AND s.login='john_doe'" | awk '{ print "PSA_PASSWD=x27" $2 "x27 /usr/local/psa/admin/sbin/usermng --add-user --user=" $1 " --homedir=" $3 " --shell=" ($4?$4:"/bin/false")}' | sh -x

    • For several missing system users, run the same command but for all users instead. Note that already existing users will not be re-created:

      # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"select s.login, a.password, s.home, s.shell from sys_users s, accounts a where a.id = s.account_id" | awk '{ print "PSA_PASSWD=x27" $2 "x27 /usr/local/psa/admin/sbin/usermng --add-user --user=" $1 " --homedir=" $3 " --shell=" ($4?$4:"/bin/false")}' | sh -x 1>/dev/null 2>&1

  3. Repair file access permissions for /vhosts/ directories

    • Via Plesk UI:
      Log into Plesk and go to Tools & Settings > Diagnose & Repair > File System > click Repair

    • Via CLI:

      # /usr/local/psa/bin/repair --restore-vhosts-permissions