mail

Minimal Debian setup on a Raspberry Pi 4


Introduction

Some context data :

"Install" Debian on the SDCard

  1. download the Debian image matching your hardware as well as the corresponding SHA256 checksum file
  2. check the downloaded file :
    sha256sum -c 20200909_raspi_4.xz.sha256
    20200909_raspi_4.img.xz: OK
  3. identify the SDCard :
    • Do this before and after plugging the SDCard, the device that will appear is the SDCard :
      NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
      sda               8:0    0 111.8G  0 disk
      ├─sda1            8:1    0  55.9G  0 part /
      └─sda2            8:2    0   7.5G  0 part [SWAP]
      sdb               8:16   0   3.7T  0 disk
      └─sdb1            8:17   0   3.7T  0 part
        ├─myLVM-homes 254:0    0     4T  0 lvm  /home
      
      sde               8:64   1  28.9G  0 disk		here it is!
      ├─sde1            8:65   1   299M  0 part
      └─sde2            8:66   1  28.6G  0 part
      
    • Alternate method, as root :
      tail -f /var/log/messages
      
      Sep 14 20:06:52 myWorkstation kernel: [ 9592.290555] sd 8:0:0:0: [sde] 15687680 512-byte logical blocks: (8.03 GB/7.48 GiB)
      Sep 14 20:06:52 myWorkstation kernel: [ 9592.291638] sd 8:0:0:0: [sde] Write Protect is off
      Sep 14 20:06:52 myWorkstation kernel: [ 9592.292758] sd 8:0:0:0: [sde] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
      Sep 14 20:06:52 myWorkstation kernel: [ 9592.319790]  sde: sde1 sde2
      Sep 14 20:06:52 myWorkstation kernel: [ 9592.324091] sd 8:0:0:0: [sde] Attached SCSI removable disk
      
  4. "flash" the image to the SDCard, as root :
    xzcat 20200909_raspi_4.img.xz | dd of=/dev/sde bs=64k oflag=dsync status=progress

Boot

  1. place the SDCard into its slot
  2. connect keyboard + mouse + monitor
  3. plug the AC adapter : the boot starts

After the boot

  1. You should get a prompt like :
    Debian GNU/Linux 10 rpi4-20200909 tty1
    
    rpi4-20200909 login: 
    login : root, password : no password (source)
  2. configure the keyboard layout
  3. make everything up-to-date :
    apt update && apt upgrade && apt dist-upgrade
  4. make the SSH configuration very unsecure :
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
    echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config
    sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
    systemctl restart ssh
    no need to change PasswordAuthentication since it defaults to yes
  5. open an SSH session from another computer :
    ssh -F /dev/null root@ip.address.of.raspberry
    You should be instantly logged in as root with no password prompt.
  6. TO BE CONTINUED...