3. Configuring the Pi¶
3.1. raspi-config¶
A lot of the Pi’s system settings are configured in raspi-config
, a terminal/shell based tool. When we run this tool, we will run them as a root user, the root has the permission to modify files or default settings as an administrator. By default on Raspbian (the operating system of our Pi) the root user is pi
and the root password associated to the root user is raspberry
. To operate as a root user in the terminal every command is preceded by the sudo
(super user do) command.
Type the following command and press ‘Enter’ to open the configuration menu of the Pi:
$ sudo raspi-config
Note
The $
symbol in front of the command signifies when this command should be written in the terminal window. When writing the command you should not write the dollar sign, only the command: sudo raspi-config
.
The terminal will show a menu. The options can be navigated with the vertical keys of your keyboard, to accept the options press ‘Enter’, to finish press the lateral keys of the keyboard.

3.1.1. Keyboard¶
First we set up the keyboard to prevent any problem when we will change the root password. We access the option: 4 Localisation Options:

Then Change Keyboard Layout:

Then we choose Generic 105 key:

And then English (UK):

Then we can choose the default options that the menu is prompting by pressing enter:



3.1.2. Timezone¶
Then we are re-directed to the main menu, now we change the timezone from the 4 Localisation Options menu.

Then we choose Change Timezone:

Then Europe:

Then London:

3.1.3. User password¶
Now we will change the root user password. This increases the security of the connection we will establish from our laptop to the Pi. Since you are sharing this Pi with your colleagues choose a password together. To change the password we are re-directed to the main menu and here we choose the first option: 1 Change User Password:

Then we agree to change the password:

Type the new password twice:

Note
Nothing will appear on screen when you are typing the password. This is normal - it’s still working! If you need to cancel, press Ctrl+C
on the keyboard.

We have set the new password. Do not reboot the Pi yet.
3.1.4. Enable SSH¶
We will now check that the SSH is enabled. We need to enable it to connect with the Pi remotely. From the main menu we access: 5 Interfacing Options:

Then we select SSH:

Then we confirm that we want to enable the SSH server:

We confirm again:

Exit the menu by pressing the right arrow twice to select Finish and press the Enter key. You will re-enter the terminal.
3.1.5. Expand root partition¶
Lastly we will expand the root partition to fill the SD card. From the main menu we access: 7 Advanced Options:
We select 1 Expand Filesystem.

We confirm the changes. You will need to reboot the Pi for changes to be implemented (see next step).

Note
SD Cards can be split into partitions to separate storage of data. The partition has been shrunk to make the download size smaller, but we now want to expand the root parition to fill the whole SD card (allowing more space for file storage). If you do not do this you will find you are unable to create new files.
3.1.6. Reboot¶
Now reboot the Pi to ensure all your changes are made:
$ sudo reboot now
Tip
Following the new kernal update “Raspian Stretch” released in September 2017, some users have found that their settings are reset after reboot. If so, please perform Pi Configuration within the X-Environment:
- Click on Raspbian Icon
- Preference
- Raspberry Pi Settings
3.2. Adding users¶
A guide on adding new users to the Pi can be found here. Generally this is not necessary, and you can continue to use the pi
account. Just remember to change the user password for pi
from raspberry
to something new!
You can create additional users on your Raspbian installation with the adduser
command.
Enter sudo adduser bob
and you will be prompted for a password for the new user bob. Leave this blank if you do not want a password. However, we recommend that each user get a password to access remotely in the future, for example:
ssh bob@123.343.1.105
You can delete a user on your system with the command userdel
. Apply the -r
flag to remove their home folder too:
sudo userdel -r bob
The default pi
user on Raspbian is a sudoer. This gives the ability to run commands as root when preceded by sudo
, and to switch to the root user with sudo su
.