adaltas / node-nikita-arch

3 stars 4 forks source link

Nikita Arch

Steps

There are 3 main steps:

  1. Preparation: prepare a bootable disk and open an SSH access
  2. Bootstrap: Encrypt and partition the drive and finally install a minimal OS
  3. System install: Deploy all configurations, tools and services

Step 1: preparation

For now, the preparation process is manual.

Download

First, download the arch distribution as an ISO image.

Create a bootable USB stick:

The easiest way to create a bootable Arch Linux on USB is by using the Etcher GUI tool available on Linux, Windows and MacOS. Ubuntu also provide some good instructions such as the one for MacOS.

Alternatively, if you favor CLI commands, you can use the dd command to create a live USB. You can refer to the Arch Linux documentation on how to use dd for Linux, Windows and MacOS.

Boot

Ensure the target host can boot over USB and that the disks are discoverable. For Dell Precision, press F2 to enter the BIOS, and modify:

  1. General: Advanced Boot Options: Enable Legacy Option ROMs
  2. Secure Boot: Secure Boot Enable: Disabled
  3. System Configuration: SATA Operation : AHCI
  4. Save the BIOS settings and reboot while pressing F12

Boot the computer over the USB system. On startup, select "Boot Arch Linux (x86_64)".

Network activation

From the drive containing the Arch installation media:

# Connect to the internet (see: https://wiki.archlinux.org/index.php/Iwd#iwctl)
iwctl
device list
station {device} scan
station {device} get-networks
station {device} connect {my_device}

The following procedure will setup an SSH server and is only required if you wish to execute the bootstrap procedure of step 2 through SSH from an external host which is recommended. Note, the openssh package shall already be installed.

# Create new password, root user is passwordless by default (cf. `cat etc/shadow`)
passwd
# Start ssh daemon
systemctl start sshd
# Print IP address
ip a

Step 2: bootstrap

The bootstrap process can be executed either from the bootable system or from a remote location through SSH. From your host machine

  1. Clone this repository
  2. Set your target IP address in ./conf/bootstrap.coffee
  3. Edit any other configuration of interest
  4. Run npm run bootstrap
    • Here you'll be prompted to select the installation target (Local or Remote SSH). If you choose the recommended Remote SSH, you'll be prompted for target machine's below details, which will be written to conf/user.yaml:
    • hostname
    • username
    • password
    • disk encryption password

Reboot into the BIOS and create a new UEFI entry, for example set "EFI/systemd/systemd-bootx64.efi" in "Settings/General/Boot Sequence".

System (Optional)

From your host machine

  1. Clone this repository: git clone https://github.com/adaltas/node-nikita-arch.git
  2. Run ssh-keygen to create key pairs for SSH with no password
  3. Edit any other configuration of interest
  4. Run npm run system (The first time the command is run, your user configuration is created in user.yaml)

Note, system may also be executed from a remote location

  1. Edit the configuration "./conf/user.yaml" and add your SSH connection settings
  2. Enable sudo passwordless eg sudo su -; echo '<username> ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

Login

Black screen at start-up: ctrl + alt + f4 or ctrl + alt + f5 to access the terminal

Complementary documentations