System image installation
- Get the raspbian image from the official download site. The lite image doesn't have a desktop environment but is often sufficient.
- If the image is zipped, extract the .img file.
dd bs=4M if={raspbian image} of={sd card} && syncWhere{sd card}is the device (e.g./dev/sdc) and not the partition. Always double-check this value, or you could risk erasing the entirety of another disk!
First login
With keyboard and screen
- Plug the keyboard and screen in the raspberry
- Default login is pi/raspberry (beware that default keyboard layout is set as US)
With an ethernet cable
You won't need a monitor nor a keyboard for the pi. You will need an ethernet cable, another pc (with ethernet plug) and a way to edit files on the sd card.
- Edit file
/etc/dhcpcd.confon the SD card. Add these lines at the end of the file:
interface eth0
# This address can actually be what you want
static ip_address=10.0.0.1/24
- Follow the "enable ssh" section to enable the ssh service.
- Connect your computer directly to the pi through an ethernet cable (you don't need a crossover cable, the pi can handle a normal cable fine).
- On you computer set a static address for the ethernet on the same ip pool as the pi. A way of doing this can be
sudo ifconfig {ethernet interface} 10.0.0.2/24 - You can now ssh into the pi and do whatever you want.
- Don't forget to undo your modifications to
/etc/dhcpcd.confwhen you are finished or the pi will always have a static address on every ethernet connection you make - If you want to set up a wifi connection just look at the following section (you don't need to edit files on the SD card, you can do it directly on the pi since you are now connected to it).
Through a wifi connection
You won't need a monitor nor a keyboard for the pi. You will need a running wifi network to which the pi can connect, and a way to edit files on the sd card.
- Follow the "set up a wifi connection" section
- Follow the "enable ssh" section in order to enable the ssh service of the pi.
- (Re)Start the pi, it should automatically connect to the wifi and you should be able to connect to it through ssh.
- Access the pi through ssh.
Set up a wifi connection
- Find the ssid of your network
- You may know it.
- Or, From a linux computer run
iwlist wlan0 scanand search for the ssid entries.
- Edit file
/etc/wpa_supplicant/wpa_supplicant.confon the pi.- Add at the end of the file:
network={
ssid="{ssid}"
psk="{wifi password}"
}
You must not put spaces around =
The pi should automatically connect to the wifi network on startup.
Enable SSH
By default the ssh service is not running on the pi. In order to enable it you must create a file named ssh in the boot partition of the SD card. The content doesn't matter.
The pi will see the file and start ssh at boot. But beware that the file will be deleted. To enable ssh service to start at every boot you need to run systemctl enable ssh once connected to the pi.
Change keyboard layout
By default layout for keyboards connected to the pi is en_us. To change it run as root:
dpkg-reconfigure keyboard-configurationservice keyboard-setup restart- You may need to reboot the pi
Remove default user
It is better to create a new non-root user and delete the default 'pi' user.
- Run ../common/first_steps/adduser.sh as root, add it to
sudogroup. - Check that the newly-created user can connect to the pi and use sudo to connect as root.
- As root, run
userdel -r pi. This will delete the user and its home directory.