To enable root login via SSH on CentOS Stream 10, follow the steps below to configure your server securely and efficiently.
Step 1 : Start by verifying the status of the SSH service to ensure it is running. Use the following command:
Step 2 : If the root account is not enabled, reset its password using the command:
Follow the prompts to set a new password for the root user.
Step 3 : Open the SSH configuration file for editing:
Step 4 : Locate the line containing #PermitRootLogin
and update it as follows:
Make sure to remove the #
at the beginning of the line to uncomment it. Save and exit the file.
Step 5 : Apply the changes by restarting the SSH service:
---
Step 6 : Try connecting to your server using the root account via SSH:
Enter the password you set earlier to log in.
Congratulations! You have successfully enabled root login via SSH on CentOS Stream 10.