Create a new user
The following notes assume you've setup you RPi and are logged in with an existing user who has sudo powers.
sudo adduser <newusername>
<newusername> means select you own username for example.
Follow the on screen instructions to enter and confirm the users password, the additional information may be left blank by just hitting the return key.
Test the new user
Logout of the current user
At the prompt login using
<newusername> and the password.
Super user powers
The new user does not have super user powers.
sudo powers can be authorised only by an existing
Logout, and back in as
Gives a CLI editor view of the sudoer configuration file using Joe's own Editor.
Add following Line under the
"root ALL=(ALL) ALL" Line:
<newusername> ALL=(ALL) ALL
at the same time comment out
pi's super powers. Change
pi ALL=(ALL) ALL
#pi ALL=(ALL) ALL.
Save the file, press
Ctrl-K,X which should result in
File /etc/sudoers.tmp saved
The default raspian build use the
sudo group to control suo permissions.
Add your new user using
sudo gpasswd -a <username> sudo
and remove Pi's privileges using
sudo deluser pi sudo
One the next reboot
<newusername> will have and
pi will no longer have sudo powers.
Consider removing Pi altogether
If you've got your own user with sudo privs, there's a good security case to remove user Pi in case he has access to other groups which could cause problems. Completely remove all traces of Pi using. DO NOT do this is you haven't got another user with SUDO powers already set up!.
sudo userdel -rf pi