Normally when you launch a Linux instance in OpenStack, remote root login has been disable via cloud-init.
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 /root/.ssh/authorized_keys
:
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"
In /etc/ssh/sshd_config
you will need to ensure that PermitRootLogin
is set to without-password
:
PermitRootLogin without-password
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 disable_root
to false
:
disable_root: false
Now you should be all set to go and root access via SSH will be enabled.
Enjoy :-)