HestiaCP permissions issue

On a clean Debian 9 VPS:

ssh [email protected]
apt update
apt upgrade
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh
bash hst-install.sh
reboot

The “admin” home and some subdirectories are owned by “root”:

ls -l /home/
total 4
drwxr-xr-x+ 6 root root 4096 Oct 2 09:49 admin

ls -l /home/admin/
total 16
drwxr-xr-x 5 root root 4096 Oct 2 09:49 conf
drwxr-x–x 2 root root 4096 Oct 2 09:49 mail
drwx------ 2 admin admin 4096 Oct 2 09:49 tmp
drwxr-xr-x 3 admin admin 4096 Oct 2 09:49 web

This causes problems when from desktop PC:

ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/wibol/.ssh/id_ed25519.pub”
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
[email protected]’s password:
mkdir: cannot create directory ‘.ssh’: Permission denied

For solve it, it’s necessary to make:

ssh [email protected]
mkdir /home/admin/.ssh/
chown admin:admin /home/admin/.ssh/

Is this a bug? Does HestiaCP needs that “admin” directory and some subdirectories are owned by “root”?

No, this is not a bug, basicly it is by design. Please find the same bugreport here: https://github.com/hestiacp/hestiacp/issues/580

Would it be possible for the installation script to create the directory /home/admin/.ssh/ and change the owner? Or with v-add-user?

I agree this makes sense, authentication with ssh keys should work out of the box.