Setup: The Password

Right out of the box the Raspberry Pi needs a bit of finesse to get things working.  One of the most important things to do first is change your password.  Otherwise anyone can log in to it.

Let’s update our password for the default pi and root users.

passwd pi

Follow the prompt to enter and confirm your password.

passwd root

Follow the prompt again for the root password.

 

Let’s test our passwords to make sure they work.  You can change between these two users using the su command.  Starting from the pi user change to the root user.

su

Follow the prompt to enter your password.  Now you will see that pi@ will change to root@ and the $ before your cursor will change to #.

You are now root and can enter any command and make any changes to any files with out having to enter your password.  Be careful with that.

Change back to the pi user.

su pi

Enter your password and root@ will change to pi@ and the # will change to $.  Now you are not able make changes to important files or execute certain command with out putting sudo before the command.

Advertisements