[EN] How to enable root access for Cloud Server AlmaLinux

First time using Cloud Server, Linux will disable root access and you can’t SSH login with root user.

After creating a Cloud Server, you will receive an email informing Username and Password to login

You can use Username and Password we’re informing via Email and enable the root access

1. SSH Login with Username: almalinux and Password from email, First time SSH login the system will require to change password one time.

Current password: = Enter password from email
New password: = Enter new passsword (Can enter current password if you want)
Retype new password: = Retype new password again

After set the new Password, it will auto logout. You can SSH login again with Username: almalinux and New Password

2. After SSH Login with Username: almalinux and new password, use this command to be root

sudo -i

3. Set Root Password by run this command.

passwd

New password: = Enter new password for root
Retype new password: = Retype new password for root again

It will show “all authentication tokens updated successfully”

4. Edit the file /etc/ssh/sshd_config and change the following line

#PermitRootLogin prohibit-password

with

PermitRootLogin yes

Save the updated /etc/ssh/sshd_config file.

5. Restart SSH Server by run this command

systemctl restart sshd

Now you can SSH Login with user root.

Was this article helpful?

Related Articles