How to turn on root login through Private Key SSH

Wednesday, 01 January 2020 | Views: 154

Hello mates!

-- I'm gonna share a method to enable root login on every Virtual Machine hosted on GCP/AWS or Azure.
It's very easy!

Follow these steps:

  • Login to your VPS through PrivateKey (putty)
    Choose your Pvt Key! and Login.

  • Now login with your OS username like "ubuntu" or "debian"

  • Now type this command:
    sudo su (to change user to root)
    passwd (to set root password)
    nano /etc/ssh/sshd_config (to edit SSH config)

  • Now change 2 lines:

1- PemitRootLogin no (to) PermitRootLogin yes
2- PasswordAuthentication no (to) PasswordAuthentication yes

and then save the file by pressing CTRL+X and after that Press Y & enter.

  • Now restart the SSH service.
    service sshd restart

and login with root username next time!
It will work well.

Servzen Staff.

Back to list

Knowledge base categories