gptformat, withUEFIboot system and encrypted root
- install arch linux as a single partition with lvm partition for boot, root, home, swap, and hibernation virtual partitions.
- encrypt the entire system
- unlock encryption with usb key
- setup a light weight i3 desktop environment
- use rufus for writing iso to usb with windows
- use balenaEtcher for writing iso to usb with mac
wifi-menu
will refer to the machine having linux installed as instalation machine and a the computer not having linux installed on it as the primary machine.
setterm -blength 0
passwd
- make sure that this line is uncomented in
/etc/ssh/sshd_config PermitRootLogin yes
ifconfig
- from primary machine
ssh root@IP_ADDRESS
shred --verbose --random-source=/dev/urandom --iterations=3 /dev/sdX- this takes forever and you might prefer doing 1 itteration if it's a large disk
cfdisk /dev/sdY
| Partition | Size | Type | Use |
|---|---|---|---|
| /dev/sdY1 | 256MB | EFI System Partition | /boot/efi |
| /dev/sdY2 | 512MB | Linux filesystem | /boot |
| /dev/sdY3 | 256MB | EFI System Partition | key file partition |
| /dev/sdX4 | - | Linux filesystem | the rest of the drive free to use for other stuff |
shred --verbose --random-source=/dev/urandom --iterations=3 /dev/sdX
- List all disk partitions
fdisk -l - make sure to check disk file type for
gpt - Edit disk partition of choice
cfdisk /dev/sdX
| Partition | Size | Type | Use |
|---|---|---|---|
| /dev/sdX1 | +32GB | Linux filesystem | lvm partition (root/home/swap) |
- load dm-crypt
modprobe dm-crypt - load dm-mod
modprobe dm-mod
mkfs.ext4 /dev/mmcblk0p1mkdir /mnt/vaultmount /dev/mmcblk0p1 /mnt/vaultmkdir /mnt/vault/syskeys- give ownership to root.
- make read only after keys are created.
- add keyfile to vault
dd bs=512 count=4 if=/dev/urandom of=/mnt/vault/syskeys/rootKeyfile
cryptsetup luksFormat -v -s 512 -h sha512 /dev/sda1- ... enter password x2
cryptsetup luksAddKey /dev/sda1 /mnt/vault/syskeys/rootKeyfile- ... enter password x1
- add keyfile to vault
dd bs=512 count=4 if=/dev/urandom of=/mnt/vault/syskeys/homeKeyfile
cryptsetup luksFormat -v -s 512 -h sha512 /dev/sda2- ... enter password x2
cryptsetup luksAddKey /dev/sda2 /mnt/vault/syskeys/homeKeyfile- ... enter password x1
chmod 600 /mnt/vault/syskeys
- open root as alias luks_root
cryptsetup open /dev/sda1 luks_root --key-file /mnt/vault/syskeys/rootKeyfile- root now at
/dev/mapper/luks_root
- open root as alias luks_home
cryptsetup open /dev/sda2 luks_home --key-file /mnt/vault/syskeys/homeKeyfile- home now at
/dev/mapper/luks_home
umount -R /mntcd /mnt/ && rm -rf /vault
- format /boot/efi
mkfs.vfat -n "EFI System Partition" /dev/sda3 - format /boot
mkfs.ext4 -L boot /dev/sda4 - format /
mkfs.ext4 -L root /dev/mapper/luks_root - format /home
mkfs.ext4 /dev/mapper/luks_home - format /home/share
mkfs.exfat /dev/mmcblk0p2
- create and mount root
mount /dev/mapper/luks_root /mnt/
- create /boot and mount
mkdir /mnt/bootmount /dev/sda4 /mnt/boot
- create and mount efi partition in /boot
mkdir /mnt/boot/efimount /dev/sda3 /mnt/boot/efi
- create and mount home
mkdir /mnt/homemount /dev/mapper/luks_home /mnt/home
- create and mount share
mkdir /mnt/home/sharemount /dev/mmcblk0p2 /mnt/home/share
- create and mount vault
mkdir /mnt/boot/vaultmount /dev/mmcblk0p1 /mnt/boot/vault
- install to /mnt
pacstrap -i /mnt/ base base-devel efibootmgr grub
genfstab -U /mnt/ > /mnt/etc/fstab
- chroot in
arch-chroot /mnt/ - set password
passwd - add real user
useradd -m -g users -G wheel MYUSERNAMEpasswd MYUSERNAME
- add sudo privaleges group wheel
nano /etc/sudoers- uncomment
%wheel ALL=(ALL) ALL
- edit local
nano /etc/locale.gen - remove
#from language (en_US.UTF-8)- ...save
- set locale, run:
locale-genecho LANG=YOUR_LOCALE > /etc/locale.conf-->echo LANG=en_US.UTF-8 > /etc/locale.confexport LANG=YOUR_LOCALE-->export LANG=en_US.UTF-8
- set timezone
ln -sf /usr/share/zoneinfo/YOUR_REGION/YOUR_CIT /etc/localtime-->ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime - set clock
hwclock --systohc --utc - set hostname
echo YOUR_HOSTNAME > /etc/hostname - edit hosts
nano /etc/hosts - add to file:
127.0.0.1 localhost your_hostname
::1 localhost your_hostname
- ...save
- update Pacman
pacman -Syu - install dialog so you can access wifi-menu after booting into OS
pacman -S dialog - install os-prober and ntfs-3g so grub will automatically identify other OS's on your system wen generating a boot menu
pacman -S os-prober ntfs-3g
- edit grub
nano /etc/default/grub- set
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda1:luks_root cryptkey=/dev/mmcblk0p3:luks_vault:ext4:/vault/syskeys/rootKeyfile - uncomment (
#)GRUB_ENABLE_CRYPTODISK=y - ..save
- set
- Now edit /etc/mkinitcpio.conf
nano /etc/mkinitcpio.conf- add ext4 vfat mmc_core mmc_block sdhci sdhci-pci ata_generic ata_piix nls_cp437 to
MODULES - In the
HOOKSsection, add encrypt and [lvm2] after block - ...save
- add ext4 vfat mmc_core mmc_block sdhci sdhci-pci ata_generic ata_piix nls_cp437 to
- generate initramfs
mkinitcpio -p linux
-
edit /etc/crypttab to mount /home dir
nano /etc/crypttab
# <name> <device> <password> <options> home /dev/sda2 /boot/vault/syskeys/homeKeyfile luks,timeout=15 -
install GRUB
grub-install --target=x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id=ArchLinux -
check for other os's :
os-prober -
generate GRUB configuration
grub-mkconfig -o /boot/grub/grub.cfggrub-mkconfig -o /boot/efi/EFI/ArchLinux/grub.cfg
- and then exit
exit - unmount all
umount -R /mnt - and reboot
reboot
- log back in as
rootuser - connect to internet with
wifi-menu- For VM:
systemctl enable [email protected]
- For VM:
- Install GUI
- I like GNOME, so:
pacman -S gnome
- I like GNOME, so:
- update repo database & install Pakku
- get git
pacman -S git - open to Downloads (or anywere really)
- run
git clone https://aur.archlinux.org/pakku.git - open pakku foled
cd pakku - install pakku
makepkg -si - you can delete the pakku repo now
cd ..and thenrm -rf pakku
- get git
- Optional gnome install
- gnome-extra has a buch of packages I don't like
- these are individual packages from gnome-extra I do like
pacman -S gnome-nettool gnome-tweaks gnome-usage gnome-weather nautilus-sendto pacman-contrib
- Applications I like to have
pacman -S atom gimp vlc libreoffice-fresh firefox thunderbird pidgin
- Start/enable system applications
systemctl enable NetworkManager.servicesystemctl enable paccache.timersystemctl enable gdm.service
- restart system with
reboot