Difference between revisions of "AddingUsers:RPi"

From SingletonMillerWiki
Jump to: navigation, search
m (Consider)
 
(8 intermediate revisions by the same user not shown)
Line 46: Line 46:
 
Save the file, press <code>Ctrl-K,X</code> which should result in
 
Save the file, press <code>Ctrl-K,X</code> which should result in
 
<pre>File /etc/sudoers.tmp saved</pre>
 
<pre>File /etc/sudoers.tmp saved</pre>
 +
 +
=== Raspian ===
 +
The default raspian build use the <code>sudo</code> group to control suo permissions.
 +
 +
Add your new user using
 +
<pre>
 +
sudo gpasswd -a <username> sudo
 +
</pre>
 +
 +
and remove Pi's privileges using
 +
<pre>sudo deluser pi sudo</pre>
  
 
One the next reboot <code><newusername></code> will have and <code>pi</code> will no longer have sudo powers.
 
One the next reboot <code><newusername></code> will have and <code>pi</code> 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!.
 +
 +
<pre> sudo userdel -rf pi </pre>

Latest revision as of 10:13, 29 July 2012


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 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