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:
- Login to your PI as
raspberryor changed password)
- Elevate yourself to super user
- Revoke current (unknown) root’s password
- Set root’s password to the one that you know
- Verify that you can login as a root
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.