This is a short descrieption for setup a headless (without Monitor/Display) Raspberry Pi with Raspbian under Linux using the shell.
- First download a raspbian image from here and verify the sha256sum.
- Secondly write the image to an microSD-Card.
unzip RASPBIAN_IMAGE | sudo dd of=/dev/mmcblk0 bs=4M conf=fsync status=progress
.- Replace
RASPBIAN_IMAGE
with the image that you downloaded before. - Replace
/dev/mmcblk0
with your device name. bs=4M
make it faster, but maybe it causes problems, if it does, skip it.conf=fsync
can also causes problems, if you skip it, don't forget to runsudo sync
after the command has finished.
- Replace
- Now we need to enable the ssh-server:
sudo mount /dev/mmcblk0p1 /mnt && sudo touch /mnt/ssh && sudo umount /mnt
.- Replace
/dev/mmcblk0p1
with the first partition on your SD-Card.
- Replace
- Now we give the Raspberry Pi a static IP-Address:
sudo mount /dev/mmcblk0p2 /mnt && sudo vim /mnt/etc/dhcpcd.conf
- Replace
/dev/mmcblk0p2
with the second partition on your SD-Card. - If you don't want to use vim you can also use nano or any other texteditor.
- Than add the following lines to
/mnt/etc/dhcpcd.conf
:
interface eth0 static ip_address=192.168.20.1/24
- IP:
192.168.20.1
- On Interface
eth0
- Subnetmask:
255.255.255.0
- Replace
sudo umount /mnt
- Now put the microSD-Card into your raspi and start it.
- You need a Computer with a network card that can speek Gigabit.
- Now all you have to do is add a new connection to the NetworkManager and set it manually.
- IP (for you Computer):
192.168.20.2
- Subnetmask:
255.255.255.0
- IP (for you Computer):
- Finish!!
- To open a shell on your raspi:
ssh pi@129.168.20.1
- Password:
paspberry
- Password: