Raspberry Pi: Change default user pi

Ok, you get your raspberry pi up and running but like any fresh install of raspbian, the default user is pi and the password is also default (and known by the entire community).

So, it’s time to change that user to your favorite username (and a new password).

Create a temporary sudo user

On the pi:

sudo adduser proot
sudo usermod -G sudo proot

Now, log out and log in as proot.

Rename pi user and its home directory, set its new password

sudo usermod -l myfavoriteusername -d /home/myfavoriteusername pi
cd /home
sudo mv pi myfavoriteusername
sudo passwd myfavoriteusername

Now, log out and log in as myfavoriteusername

Delete temporary sudo user

sudo userdel -r proot


You’re done. One step further in a more secure machine.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *