Applicable to:
- Plesk for Linux
Symptoms
-
Additional FTP accounts added in Plesk > Domains > example.com > FTP Access becomes the owner of the site's vhost:
# ls -ld /var/www/vhosts/plesktest.com/
drwx-x--. 5 ftpaccount psaserv 52 Oct 9 18:51 /var/www/vhosts/plesktest.com/ - The PHP running under an additional FTP user instead of the subscription's system user.
Cause
Such behaivior related to the fact that recently, a system user of a subscription was renamed in Domains > example.com > Web Hosting Access. It is expected behavior.
System user of a subscription and additional FTP user are created with the same UID. It can be seen with the following command while connected to the server via SSH:
# grep 'FTPuser\|SYSuser' /etc/passwd
FTPuser:x:10013:1003::/var/www/vhosts/example.com:/bin/false
SYSuser:x:10013:1003::/var/www/vhosts/example.com:/bin/false
A username is requested by its UID. In case there are several usernames with the same UID, displayed username is the one which is placed higher in the file /etc/passwd
. It can be checked with the command below:
# getent passwd 10013
FTPuser:x:10013:1003::/var/www/vhosts/example.com:/bin/false
Please note that in centos8 this behavior was changed and OS shows the last added user:
Such behavior registered as the bug https://plesk-new.zendesk.com/hc/en-us/articles/13302929295639
Solution
To display the system user of the subscription as the owner of the subscription's files, rename the additional FTP user in Domains > example.com > FTP Access.
This will rewrite the file /etc/passwd
and put the additional FTP user at the bottom of the file. After that, the name of the FTP user can be changed back.
Comments
2 comments
Is there any way to avoid this problem? Changing the main user can be a security problem especially when the main user is chrooted (additional users are not chrooted).
This is a visual issue only, and it does not affect file access in any way. Two users with the same UID is essentially the same user, so they would have same privileges anyway (even if correct username is displayed as the owner).
Please sign in to leave a comment.