Login as root to Your Server via SSH
Learn how to securely log in as the root user to your server using SSH from your local machine, on any operating system.
To log in as root to your server, you need to know its public IP Address. Also, the password or the private key for the root user. (These details are given to you when you created the server, usually you can get them by login into your provider’s dashboard)
Connect to Your Server via SSH
On your local machine (Windows, macOS, or Linux), open a terminal/command prompt/PowerShell and run:
ssh root@your-server-ip
Replace your-server-ip with the actual IP address of your server.
Accept the warning about host authenticity if prompted. enter your server password if asked, if you are using an sshkey with
Once you are connected, you will be greeted with a welcome message from your server, and you can start running commands and managing your server.
To exit the SSH session, type exit and press enter.
