How to change your password on the Raspberry Pi

How to change your password on the Raspberry Pi

The Raspberry Pi is a small single board computer that is popular with all electronics and computer enthusiasts. Today we explain how you can improve your security, changing the password and the default user in Raspbian, the official operating system of the Raspberry Pi.

Why change Raspbian's default password

Raspbian arrived in 2015 to become the official operating system for the Raspberry Pi. It is an operating system that is based on Debian, one of the most popular and important Linux distributions.

Raspbian is an operating system that is generally very easy to use and works really well. However, there are some aspects related to safety that are not taken care of as much as they should. Fortunately, none of these problems are serious.

One of the small drawbacks that we find in Raspbian is that this operating system comes with a default username (pi) and password (raspberry) that we cannot modify during the installation process.

This is a small security issue , as any user who is aware of this could gain access to our Raspberry Pi with advanced permissions.

How to change Raspbian's default password

Changing the default password in Raspbian is quite simple, all we need to do is access the Linux command terminal, and make some small modifications.

So the first thing we need to do is open a new terminal in Raspbian , and enter the following command to create a new user. Logically we will have to replace "user" by the username that we want to put.

sudo / usr / sbin / useradd –groups sudo -m "user"

change default password of Raspbian 1

With this you will have already created the user, the next step is to assign a password. To do this use the following command

sudo passwd "user"

change Raspbian 2 default password

Raspbian will ask you to enter a password for the user, you will have to enter it twice to make sure you do not make any mistakes.

Finally, it is recommended that you disable the Pi user to prevent someone from accessing advanced functions on your Raspberry Pi, without your permission, to do this use the following command:

sudo passwd -l pi

change Raspbian 3 default password

This is all as if you have come this far, you will have been a new user with a new password on your Raspberry Pi.