So we’ve burnt an SD card, and installed our base operating system, we’ve booted the card and configured the base operating and rebooted it and logged in with out ‘pi’ user. Now its time to create a user, and install the base tools including updating the operating system
After you have logged in, its best to create a user other than pi that will do all the work, as pi is the default user and its nice to have a user that is you 😉
We create a user using the ‘adduser’ command. Enter the following command and you’ll see the system respond with something similar. Everytime ‘adduser’ asks you a question you can just press enter as the default answer is always fine at this stage
pi@raspberrypi ~ $ sudo adduser keith Adding user `keith' ... Adding new group `keith' (1002) ... Adding new user `keith' (1002) with group `keith' ... Creating home directory `/home/keith' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for keith Enter the new value, or press ENTER for the default Full Name : Room Number : Work Phone : Home Phone : Other : Is the information correct? [Y/n] pi@raspberrypi ~ $
So we now have a user created. To allow this user to be able to modify the system we have to give this user super user privileges, and this is a 2 stage process
The first stage is to use the ‘visudo’ command which brings up the file containing the list of all users with ‘su’ or super user priviledges.
pi@raspberrypi ~ $ sudo visudo
This will bring up the following screen
Underneath the line pi = ALL(ALL) NOPASSWD: ALL, enter a new line using the user you created above, the line should read keith = ALL=(ALL) ALL, and the result should look like this
To save and exit, type Ctrl-O remove the .tmp extension from the file, hit enter and the hit Ctrl-X to exit.
The next stage is to complete adding the user to su privs, enter the following command
pi@raspberrypi ~ $ sudo adduser keith sudo