GithubHelp home page GithubHelp logo

kyaulabs / aarch Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 298 KB

Automated Arch Linux is a template-based automated installer for Arch Linux.

License: GNU Affero General Public License v3.0

Shell 100.00%
arch-linux archlinux automated bash bash-script linux shell-script shell-script-linux-installer hardened hardened-image hardened-linux-scripts

aarch's Introduction

ANSI Logo
https://kyaulabs.com/

Contributor Covenant   Semantic Versioning   GitHub   Gitleaks   CI

Disclaimer

I personally use Arch Linux everywhere and with the frequency at which I was doing reinstallations increasing, eventually I needed a better solution. What started as a hardening script that was run post-installation has merged into the fully automated installation script that you see before you.

🚧 WARNING
This repository is provided for archival/educational purposes, I am not responsible for any data loss or
damage that may ensue.

Introduction

AArch or Automated Arch Linux is a template-based automated installer for Arch Linux. This script is the convergence of my Arch Linux Installation along with my Hardening Arch Linux (HAL) articles on my personal wiki.

Configuration

Before you can start aarch, a moduli must be generated. This will take a considerable amount of time depending on your CPU, if this is being executed inside of a virtualized environment it is recommended that you use haveged.

ssh-keygen -M generate -O bits=4096 moduli.c
ssh-keygen -M screen -f moduli.c moduli
rm moduli.c

After the moduli has been generated the example.aa file can be edited for a fully automated installation. This file can be named anything you like as long as it retains it's extension (eg. machine.aa). Without a template file you will instead be asked to input all of the information to the console when running aarch.

Boot up the machine and/or vm with an ARCHISO image.

Custom ARCHISO

Next decide if you want the script baked into an ISO or if you just want to scp the script to the installation environment everytime. If you choose to build your own ARCHISO it will help to follow these guidelines:

  • Use releng as your base template.
  • Add the git and wget packages to the packages.x86_64 file so that it will be installed an usable in the installation environment.
  • Revert to traditional interface names with ln -s /dev/null airootfs/etc/udev/rules.d/80-net-setup-link.rules
  • aarch, erase_hdd, firstboot.txt and moduli must be placed into in the airootfs/root directory prior to building.
  • Include an .aa template file in the airootfs/root directory for script automation.
  • Also include an wanted packages from the pkg directory.
  • Modify the profiledef.sh script to make sure aarch, erase_hdd and any packages you included have 0:0:755 setting, this sets user:group:permissions.
  • Modify the airootfs/root/.zlogin script to enable the sshd.service on boot by adding systemctl enable --now sshd.service. Then set a root password with the command chpasswd <<< "root:moo", with 'moo' being the password.

Instructions for building your own image can be found here.

Existing ARCHISO

If instead you choose not to bake the script into an ISO, simply boot an existing ARCHISO, use the E key to edit the kernel commandline at the bootloader menu, adding net.ifnames=0 to boot with traditional network interface names.

The ARCHISO will automatically log you into the root account, install git and wget.

pacman -Syy git wget

Then modify the root password and enable sshd, finally checking the assigned IP.

passwd
systemctl start sshd
ip a

Finally SCP over to the machine aarch, erase_hdd, firstboot.txt, moduli and an .aa template.

Usage

In order to run aarch properly you will need all of the following files in the home directory of the root user in the livecd environment for the machine or virtual machine you are trying to install.

aarch erase_hdd firstboot.txt moduli

In addition it also pays to have an .aa template.

To run, simply execute the script.

./aarch

This will read the first .aa template found in the current directory. If no template is found it will prompt the user to input the configuration through the console.

Absolute automation can be achieved by adding aarch to the .bashrc of the root user on the ISO in addition to including a pre-filled in .aa template.

Attribution

aarch's People

Contributors

kyau avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.