Symptoms
-
Changing the FTP user password in Plesk > Domains > example.com > FTP Access > john_doe results in the following error:
Error: SysUser::update() failed: Unable to execute usermng: usermng: PAM password change failed: 20, Authentication token manipulation error Error description: Additional info: . usermng: Failed to set password for user 'john_doe'
-
Accessing File Manager fails with the following error in Plesk UI:
external error:
Unable to find the directory /var/www/vhosts/example.com/: filemng failed: filemng: Unable to getpwnam for user john_doe User john_doe not found move process 15503 to cgroup for user john_doe failed filemng: Unable to getpwnam for user john_doe filemng: User john_doe not found
Cause
The system user was deleted from the operating system but exists in the Plesk database.
Resolution
-
Connect to the server using SSH.
-
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
-
-
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
-