Applicable to:
- Plesk for Linux
Symptoms
-
Changing the FTP user password in Plesk > Domains > example.com > FTP Access > user_example results in the following error:
PLESK_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 'user_example'
-
Accessing File Manager fails with the following error in Plesk UI:
PLESK_ERROR: Internal 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.
-
Run the following command to re-create FTP user using data from Plesk database:
# 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
Where john_doe is the missing system user.
If several system users are missing, run the same command for all users. 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
-
Comments
0 comments
Please sign in to leave a comment.