AddingUsers:RPi

From SingletonMillerWiki
Revision as of 10:12, 29 July 2012 by Martin (Talk | contribs) (added instructions on how to get rid of the Pi user entirely)

Jump to: navigation, search


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>

Here <newusername> means select you own username for example. jack.

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

logout

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 sudo user.

Logout, and back in as pi.

sudo visudo

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

to

#pi ALL=(ALL) ALL.

Save the file, press Ctrl-K,X which should result in

File /etc/sudoers.tmp saved

Raspian

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

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