Applicable to:
- Plesk for Linux
Symptoms
- Git actions on a domain failing with the following error:
PLESK_ERROR: 500 PleskUtilException
Failed to copy files storage to destination path. stderr: filemng: Cannot open destination file '/var/www/vhosts/example.com/.ssh/id_rsa.XPNIPo' System error 13: Permission denied stdout: filemng: Cannot open destination file '/var/www/vhosts/example.com/.ssh/id_rsa.XPNIPo' System error 13: Permission denied
Cause
Wrong permissions on the folder and its content: /var/www/vhosts/example.com/.ssh/
# ls -lashd /var/www/vhosts/example.com/.ssh
drwxr-xr-x. 2 root root 29 May 20 02:15 .ssh
Resolution
- Connect to a Plesk server via SSH.
- Run the command below to fix ownership on the domain example.com:
# plesk db -Ne "select ss.login from sys_users ss \
inner join hosting h \
inner join domains d \
where h.dom_id=d.id and h.sys_user_id=ss.id and d.name='example.com'" | xargs -i chown -R {}:psacln /var/www/vhosts/example.com/.ssh/
- Connect to a Plesk server via SSH.
- Run the next command to fix the .ssh/* permissions on all domains:
# plesk db -Ne "select ss.login, d.name from sys_users ss \
inner join hosting h \
inner join domains d \
where h.dom_id=d.id and h.sys_user_id=ss.id;" | xargs -l bash -c 'chown -R $0:psacln /var/www/vhosts/$1/.ssh/' 2>/dev/null
Comments
0 comments
Please sign in to leave a comment.