Download from here the appropriate image.
Flash the image on the appropriate device. Full device, not a partition, so no
number at the end of the device name, i.e. /dev/sdc
, not /dev/sdc2
:
$ xzcat <raspi_image>.img.xz | sudo dd of=/dev/<YOUR_DEVICE> bs=64k oflag=dsync status=progress
Mount the newly created root partition (number 2, assuming the device is
/dev/sda
) to a mount point:
$ MOUNTPOINT=/mnt/
$ sudo mount /dev/sda2 $MOUNTPOINT
Copy your ssh key to root's authorized_key
:
$ sudo mkdir $MOUNTPOINT/root/.ssh
$ echo "<YOUR_SSH_PUBLIC_KEY> | sudo tee -a $MOUNTPOINT/root/.ssh/authorized_key"
$ sudo chmod 600 $MOUNTPOINT/root/.ssh/authorized_key
$ sudo chmod 700 $MOUNTPOINT/root/.ssh/
ssh.service
unit is yet enabled. Modify $MOUNTPOINT/etc/ssh/sshd_config
to
allow root login, uncommenting the line with PermitRootLogin
to obtain:
PermitRootLogin prohibit-password
Debian supports the old way via /etc/network/interfaces
. Modify
$MOUNTPOINT/etc/network/interfaces.d/eth0
:
auto eth0
iface eth0 inet static
address <raspi_address>
submask <netmask>
gateway <gateway_address>
Most likely:
address
:192.168.1.i
beingi
a number in the1-255
rangenetmask
:255.255.255.0
gateway
:192.168.1.1
Plug the raspberry in a socket and attach the ethernet cable. ssh
into it with