If you’re just playing around on a Raspberry Pi and you don’t feel like constantly sudoing to root, enable root to login directly! Sure this is not best practice and it promotes bad sysadmin behaviours, but it’s a real time saver when you’re just playing in the Raspberry PI sandbox and you don’t care about security or safety. It’s like joyriding without your helmet on.
Here’s the trick to allowing root to login to a Raspberry. By default, ssh is turned off, so you’ll need to enable that. Then, you can make your Raspberry less secure by allowing root in without first sshing as a regular user.
Edit the ssh configuration
grep for the following:
and change it to
Don’t forget to remove the octothorpe (#) to uncomment the line! Save the file and restart sshd:
systemctml restart sshd
Yes, this will break your ssh connection, but it will resume once sshd restarts. Now, log out and log back in as root. You did, at least, set / change root’s password, didn’t you?