% Historique installation ECAZ


### history

```
# history | cut -c8-
apt install ifupdown
cat << EOF > /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
EOF
cat << EOF > /etc/resolv.conf
nameserver 1.1.1.1
nameserver 1.0.0.1
EOF
_hostname=ecaz
_domain=aezi.fr
echo "$_hostname" > /etc/hostname
echo "127.0.1.1 $_hostname.$_domain $_hostname" >> /etc/hosts
echo "Europe/Paris" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
reset
cat << EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free-firmware
# deb-src http://deb.debian.org/debian bookworm main contrib non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
# deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
# deb http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware
# deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
# deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
EOF
cat << EOF > /etc/apt/apt.conf.d/999aptsettings
APT::Install-Recommends "0";
APT::Install-Suggests "0";
EOF
apt update && apt install -y busybox console-setup cryptsetup dropbear grub-pc initramfs-tools kbd linux-image-amd64 linux-perf locales ssh dropbear-initramfs cryptsetup-initramfs
mkdir /root/.ssh && chmod 600 /root/.ssh
mkdir /etc/dropbear-initramfs/ && chmod 600 /etc/dropbear-initramfs/
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /root/.ssh/authorized_keys
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /etc/dropbear-initramfs/authorized_keys
mkdir -p /root/.ssh && chmod 600 /root/.ssh
mkdir -p /etc/dropbear-initramfs/ && chmod 600 /etc/dropbear-initramfs/
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /root/.ssh/authorized_keys
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /etc/dropbear-initramfs/authorized_keys
sed -i.old s/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"net.ifnames=0\ biosdevname=0\ ip=:::::eth0:dhcp\"/g /etc/default/grub
less /etc/default/grup
less /etc/default/grub
nano /etc/dropbear-initramfs/config
nano /etc/dropbear-initramfs/config
ll /dev/mapper
alias ll='ls -l'
ll /dev/mapper
nano /etc/initramfs-tools/initramfs.conf
cp /etc/initramfs-tools/initramfs.conf /etc/initramfs-tools/initramfs.conf.original
nano /etc/initramfs-tools/initramfs.conf
nano /etc/dropbear-initramfs/config
nano /etc/dropbear-initramfs/config
cat /etc/dropbear-initramfs/authorized_keys
cat /root/.ssh/authorized_keys 
nano /etc/dropbear-initramfs/authorized_keys
nano /root/.ssh/authorized_keys 
cat /etc/crypttab
nano /etc/crypttab
update-grub && update-initramfs -u -k all
cat /etc/dropbear-initramfs/authorized_keys
nano /etc/dropbear-initramfs/authorized_keys
less /etc/default/grub
nano /etc/default/grub
blkid
nano /etc/default/grub
update-grub && update-initramfs -u -k all
/usr/sbin/grub-probe
/usr/sbin/grub-probe --help
ll /boot/grub/device.map
/usr/sbin/grub-probe -v -t cryptodisk_uuid
/usr/sbin/grub-probe -v -t cryptodisk_uuid /Dev/md1
/usr/sbin/grub-probe -v -t cryptodisk_uuid /dev/md1
/usr/sbin/grub-probe -v /dev/md1
nano /etc/default/locale 
update-locale
update-locale --help
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
nano /etc/default/locale 
update-locale 
nano /etc/default/locale 
ssh-keyscan localhost 2> /dev/null | ssh-keygen -l -f -
locale-gen
update-locale 
dpkg-reconfigure locales
less /etc/default/locale 
update-locale
update-grub && update-initramfs -u -k all
blkid
ll /dev/vg_raid
ll /dev/vg_raid/lv_root
blkid lv_root
blkid | grep lv_root
nano /etc/fstab
mount | grep boot
blkid | grep md1
nano /etc/fstab
update-grub && update-initramfs -u -k all
ll /dev/md1
dpkg-reconfigure mdadm
apt install mdadm
update-grub && update-initramfs -u -k all
cat /etc/mdadm/mdadm.conf
ll -d /etc/dropbear-initramfs/
ll /etc/dropbear-initramfs/
dpkg-reconfigure dropbear
dpkg-reconfigure dropbear-initramfs
cat /etc/crypttab 
blkid | grep 5e99eca6
apt install busyox dropbear*
apt install busybox dropbear dropbear-initramfs
cat /etc/dropbear/initramfs/dropbear.conf 
mkdir -p /etc/dropbear/initramfs/ && chmod 600 /etc/dropbear/initramfs/
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /etc/dropbear/initramfs/authorized_keys
less /etc/dropbear/initramfs/config
less /etc/dropbear/initramfs/dropbear.conf 
cat /etc/dropbear-initramfs/config
rm /etc/dropbear-initramfs/config
nano /etc/dropbear/initramfs/dropbear.conf 
update-grub && update-initramfs -u -k all
cat /etc/crypttab 
blkid | grep 5e99eca6
cat /etc/mdadm/mdadm.conf
blkid | grep ba46c22d
lsblk
lsblk -o name,uuid,mountpoint
lsblk
lsblk -o name,uuid,mountpoint
blkid
lsblk -o name,uuid,mountpoint /dev/md1
lsblk -o name,uuid,mountpoint /dev/md0
lsblk  /dev/md0
blkid | grep md0
cat /etc/crypttab 
blkid | grep raid_crypt
apt install cryptsetup-initramfs
dpkg-reconfigure cryptsetup-initramfs
sudo blkid
blkid
sudo echo bonjour
blkid | grep raid
cat /etc/crypttab 
blkid | grep 5e99eca6-5db2-4f4b-bea8-6c6dff404406
dmsetup targets
apt install cryptsetup
ll /dev/mapper
ll /dev/dm-3
cat /etc/crypttab 
ll /cryptroot/crypttab
update-initramfs -u -k all
lsblk -fs
man crypttab
mdadm --detail --scan
cat /etc/crypttab 
cat /etc/mdadm/mdadm.conf 
cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.autogenerated
mdadm --detail --scan >>  /etc/mdadm/mdadm.conf
nano /etc/mdadm/mdadm.conf 
update-initramfs -v -u -k all
update-initramfs -u -k all
apt install mdadm
apt search mdadm
less /etc/crypttab
nano /etc/crypttab
update-initramfs -u -k all
adduser lauhub
adduser lauhub sudo
ll /home/lauhub/
mkdir /home/lauhub/.ssh/
touch /home/lauhub/.ssh/authorized_keys ; chmod 600 /home/lauhub/.ssh/authorized_keys
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEyzZAymNeWxeDjSUzkyEJLzwGqZt+VvdmidomWL0QLb lauhub@Mac-15-Laurent.local" >> /home/lauhub/.ssh/authorized_keys
chmod 600 /home/lauhub/.ssh/authorized_keys
cat /home/lauhub/.ssh/authorized_keys 
ll /home/lauhub/.ssh/authorized_keys 
nano /etc/default/grub
update-grub 
update-initramfs -u -k all
apt install zstd
update-initramfs -u -k all
exit
alias ll='ls -l'
less /etc/default/grub.d/init-select.cfg 
less /etc/default/grub
less /etc/default/grub
less /etc/initramfs-tools/initramfs.conf
less /etc/initramfs-tools/initramfs.conf
nano /etc/initramfs-tools/initramfs.conf
less /etc/dropbear/initramfs/dropbear.conf
apt install dropbear-initramfs
man 8 dropbera
man 8 dropbear
ll /etc/dropbear-initramfs/
rm /etc/dropbear-initramfs/authorized_keys 
rmdir /etc/dropbear-initramfs/
echo 'IP="${ip_address}::${gateway_ip}:${netmask}:${optional_fqdn}:${interface_name}:none"'
ll /etc/initramfs-tools/conf.d/ip
apt install manpages
man 8 dropbear
apt install man 
man 8 dropbear
man 5 initramfs.conf
man initramfs-tools
nano /etc/default/grub
man initramfs-tools
man 8 dropbear
nano /etc/dropbear/initramfs/dropbear.conf 
update-initramfs -u -k all
nano /etc/dropbear/initramfs/dropbear.conf 
cat /etc/dropbear/initramfs/dropbear.conf 
nano /etc/default/grub
man grub
man grub2
ip a
sudo nano /etc/network/interfaces
nano /etc/network/interfaces
man interfaces
nano /etc/default/grub
update-grub 
apt install lvm2
update-grub 
ll /etc/grub.d
less /etc/grub.d/40_custom 
less /boot/grub/grub.cfg 
man mdadm
mdadm --detail --scan
mdadm --examine /dev/sd1
mdadm --examine /dev/sda1
less /boot/grub/grub.cfg 
for identifier in {a..c} ; do grub-install /dev/sd${identifier} ; done
ls /sys/firmware/efi
find /sys/firmware/ -name '*efi*'
apt install efibootmgr
efibootdump
efibootdump /dev/sda
efibootmgr
cat /etc/default/grub
cat /etc/dropbear/initramfs/dropbear.conf 
cat /etc/crypttab 
cat /etc/fstab 
cat /etc/mdadm/mdadm.conf 
history | cut -c8-
```

