Enabling the root user is not recommended.
I recommend creating a firewally (security group) rule that only allows access to port 22 from your public IP address or CIDR block.
To enable the root user, you need to modify the SSHD configuration. The exact file and feature depend on the operating system.
For most Linux system:
- Change this line to
PermitRootLogin yes or
PermitRootLogin without-password or
PermitRootLogin prohibit-password. The exact one to use depends on your setup (username/password or only SSH keypairs), the OS and version.
- Restart SSH:
service ssh reload
These changes must be done as root or sudo each command. These changes only affect new connections.
Note: Make sure that you have a backup (snapshot or image) of your system before making changes. Mess up SSH and your system access will be gone.
The above changes allow the root user to login. They do not specify the method to login. The simplest method is to copy your public key stored in your account on that system to the root user:
cp /home/myusername/.ssh/ /root/.ssh/
Now you can login with the same private key with the username
I recommend create a new keypair for the root user.