Saturday, January 4, 2014

Create Your User on Raspberry Pi and Remove the Default

Since Raspbian comes with a standard user/password for all installs it makes some sense to create your own user/password combination in an attempt at some security.

I'm going to be creating the user "spoon" and deleting the user "pi" today.
sudo adduser spoon
This command will prompt you for a lot of information. Fill in as much as you want. The password bit is the only real important part.

You want to make sure the user "spoon" has the same groups as the user "pi" so checkout the groups that pi is in.
groups pi
Now set those same groups to the user spoon. I like to see they are exactly the same so using these commands sets them in the exact same order
sudo usermod -g pi spoon
sudo usermod -G gpio,spi,input,netdev,users,games,plugdev,video,audio,sudo,cdrom,dialout,adm,pi spoon
Now compare them to make sure they are the same. These two commands should look identical.
groups pi
groups spoon
Lastly, log out, login as your new user, verify you have sudo power, and nuke the user "pi" out of the sky.
sudo deluser -remove-home pi 

No comments:

Post a Comment