Login as root user to Raspberry Pi

As in this article, you cannot login as a root user in Raspberry Pi (neither locally nor via SSH), because you don’t know the default’s root password. In this article, I’ll show you how to change it to be able to login to it, but only locally (still no SSH access), which is good.

Again, as in here, you should never, ever access or use root account. Instead you should use pi user (after changing its default password) and elevate it to superuser with sudo su or by casting sudo in front of each console command.

The steps goes as in here:

  1. Login to your PI as pi (with default raspberry or changed password)
  2. Elevate yourself to super user
  3. Revoke current (unknown) root’s password
  4. Set root’s password to the one that you know
  5. Logout
  6. Verify that you can login as a root

In short:

sudo su
sudo passwd root -d
sudo passwd root


You should repeat the very same steps to change default pi user password, if you haven’t done this yet.

Leave a Reply