I'll describe here how to re-enable remote root access on a Debian based instance but it won't vary too much, if at all, for other distros.
When you try and
ssh as root, you'll be greeted with a message similar to this:
Please login as the user "debian" rather than the user "root".
You'll need to remove the below from the first line of
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"debian\" rather than the user \"root\".';echo;sleep 10"
/etc/ssh/sshd_config you will need to ensure that
PermitRootLogin is set to
Then restart SSH if you had to change that setting.
The changes to
/root/.ssh/authorized_keys are made from cloud-init and there are circumstances when cloud-init will revert your change, so let's make it permanent. Edit
/etc/cloud/cloud.cfg and set
Now you should be all set to go and root access via SSH will be enabled.