- Install
dnsmasq
- Identify network device
ìp link
- set temporary static ip address
ip a add 192.168.0.66/24 dev <devicename>
- Run
sudo dnsmasq -d -i <devicename> -p 5333 --listen-address=192.168.0.66 -K --dhcp-range 192.168.0.100,192.168.0.200,12h --enable-tftp --tftp-root=</path/to/tftp/dir/>
Month: December 2023
Temporarily access NixOS with encrypted LUKS from Ubuntu Live
Setup
- Boot Ubuntu Live as usual
- Change keyboard layout with
setxkbmap <lang>
- Install useful packages with
sudo apt install vim nix-bin
Open crypt device
- Idenitify LUKS device with
lsblk --fs
. Look forcrypto_LUKS
:nvme0n1 ├─nvme0n1p1 vfat FAT32 └─nvme0n1p2 crypto_LUKS 2
- Open encrypted device with
cryptsetup luksOpen /dev/<root partition (sda2 or similar)> secure
- Check sucessfull open with
lslbk
. You should now see the crypt partition(s):nvme0n1 259:0 0 476.9G 0 disk ├─nvme0n1p1 259:1 0 549M 0 part └─nvme0n1p2 259:2 0 476.4G 0 part └─enc-pv 253:0 0 476.4G 0 crypt ├─vg-swap 253:1 0 16G 0 lvm └─vg-root 253:2 0 460.4G 0 lvm
Mount partitions
lvchange -a y /dev/vg/swap
lvchange -a y /dev/vg/root
mount /dev/vg/root /mnt
mount /dev/<boot partition (sda1 or similar)> /mnt/boot
swapon /dev/vg/swap
Temporarily access NixOS
- Access with
nixos-enter
- Optional:
- Add additional channel if needed
nix-channel --add https://github.com/NixOS/mobile-nixos/archive/refs/heads/master.tar.gz mobile-nixos
- Update channels
nix-channel --update
- Add additional channel if needed
- Change config
- Rebuild system
nixos-rebuild boot
Enable sshd for root on Ubuntu Live
- Set keyboard layout with
setxkbmap <lang>
- Update package repo with
sudo apt update
- Install sshd and vim with
sudo apt install openssh-server vim
- Update sshd config with
sudo vim /etc/ssh/sshd_config
- Set
PermitRootLogin yes
- Set
PasswordAuthentication yes
- Set
- Set password for root with
sudo passwd root
- Restart SSHD service
sudo systemctl restart ssh.service
- Login via ssh to machine