Symptoms
-
On a Plesk for Linux server, a local Git repository is configured on the subscription.
-
It is possible to work with the repository using the system user of the subscription:
# git clone http://[email protected]/plesk-git/example.git
Cloning into ‘example’…
Password for ‘http://[email protected]’:
remote: Counting objects: 2, done.
remote: Total 2 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done. -
Attempts to use Git repository as an additional FTP user created in Domains > example.com > FTP Access fail, even though the correct password is used:
# git clone http://[email protected]/plesk-git/example.git
Cloning into ‘example’…
Password for ‘http://[email protected]’:
fatal: Authentication failed for ‘http://[email protected]/plesk-git/example.git/’ -
The following error can be found in the domain’s log fileÂ
/var/www/vhosts/example.com/logs/error_log
when an additional user is used for accessing Git repository:[auth_basic:error] [pid 2972:tid 140463692547840] [client 203.0.113.2:60065] AH01618: user gituser not found: /plesk-git/example.com/info/refs
Cause
The Git extension for Plesk currently does not add additional users to the Git protected directory.
A feature request PPM-2633Â was created to address it.
Resolution
Note: Vote for these feature requests on the Plesk UserVoice portal: Multiple users for the Git extension and Add multiple Git users with SSH Key authentication
As a workaround, additional FTP users can be added to the Git protected directory manually:
-
Connect to the server using SSH.
-
Use the following commands to manage Git users:
Note: These users will not have any relations to the system users or additional FTP users: passwords changed in Domains > example.com > Web Hosting Access or Domains > example.com > FTP Access will not propagate to the protected directory automatically.
-
Add a new user:
# PSA_PASSWORD=example_password plesk sbin pdmng –add-user –vhost-name=example.com –[email protected] –user-name=exampleuser
-
Modify already existing user:
# PSA_PASSWORD=new_password plesk sbin pdmng –update-user –vhost-name=example.com –[email protected] –user-name=exampleuser
-
Remove a user:
# plesk sbin pdmng –remove-user –vhost-name=example.com –[email protected] –user-name=exampleuser
-
List existing users:
# cat /var/www/vhosts/system/example.com/pd/[email protected]
Note: Passwords stored in the file
/var/www/vhosts/system/example.com/pd/[email protected]
are encrypted
-