To enable root password login over ssh in order to edit the files type
sed -i s/^\#PermitRootLogin\ prohibit-password$/PermitRootLogin\ yes/ /etc/ssh/sshd_config
systemctl restart ssh
You can later change this back by typing
sed -i s/^PermitRootLogin\ yes/PermitRootLogin\ prohibit-password/ /etc/ssh/sshd_config
systemctl restart ssh
Open the /etc/ssh/sshd_config file with administrative privileges and change the following line:
FROM:#PermitRootLogin prohibit-password
TO:
PermitRootLogin yes
sudo systemctl restart ssh
Quelle: linuxconfig.org