For security purposes, most preinstalled operating systems disable SSH login for the root user by default. However, if you still need to execute commands with root-level permissions, you can simply use sudo, su -, or a combination sudo su - commands after logging in with your normal user credentials via SSH.
If you find it necessary to enable SSH login as root, please follow the steps below, but do keep in mind that this is generally not recommended as it can potentially weaken the security of your VPS or dedicated server:
Open your terminal and log in to your server via SSH with your regular user account.
Open the SSH configuration file by typing
sudo nano /etc/ssh/sshd_config.
Look for the line that says PermitRootLogin no. Change this line to PermitRootLogin yes. This modification permits the root user to login via SSH.
Save your changes and exit the editor (on nano, press Ctrl + X, then Y + Enter to confirm)
For these changes to take effect, you need to restart the SSH server. Run the command
sudo systemctl restart sshd.
Enabling root login weakens the security of your VPS or dedicated Server and is therefore not recommended.