Table of Contents
- Installation of AlmaLinux
- Utilizing DISA STIG Profiles
- Creating
ssh
keys - Disabling password based
ssh
logins - Allow user to
sudo
without password - Working with
fapolicyd
- Getting
wget
to work in FIPS Mode - Optional Cloud Packages
- Cloud-Init
- Cloud-Utils-Growpart
- GDisk
-
Downloading AlmaLinux
https://almalinux.org
-
Make bootable USB
-
Linux:
Insert your target USB and locate it. There are different ways to do it but here are some of them:
-
sudo fdisk -l
- this command shows you the connected block storage devices, including the USB devices. -
lsblk
- this command gives you all the available block storage devices, including the USB block storage devices. -
sudo blkid
- this command gives you the same information as lsblk, but you have to rub it as root.You need to look for /dev/sda or /dev/sdb or /dev/sdc, which is your target USB.
After you found out the location of your target USB, navigate to the location of your source ISO. Run dd command to copy files from ISO to USB:
sudo dd if=/AlmaLinux-9-latest-x86_64-dvd.iso of=/dev/sdc status=progress
dd
: Start the dd command to write DVD/CD iso image.if=AlmaLinux-8-x86_64-Live-GNOME-Mini-beta-1.iso
: path to the input file.of=/dev/sdc
: path to destination USB disk/stick. status=progress: display a progress bar while writing the image to the USB stick such as/dev/sdb
. That’s all! You now have ready Live AlmaLinux on a USB stick.
-
-
Windows:
For Windows OS there is a helpful free and open-source application - Rufus.
Open the application, choose your target USB, ISO you need to burn, press start - and Live OS is ready to run.
-
MacOS:
The cross-platform tool balenaEtcher is used to write images on macOS. It is simple too. Open banlenaEtcher, choose the image and the USB, press Flash.
More details and information about AlmaLinux Live Media can be found on Live Media SIG.
- When starting up AlmaLinux for the first time you will be granted with a welcome screen. Here select your language and keyboard type. Click Continue
- Begin Installation:
- Select User Creation: Create a user and assign that user a strong password. Make sure both
Make this user administrator
andRequire a password to use this account
are checked. Click Done - Software Selection: For this instance we will select Minimal Install. Click Done
- Security Profile: We will highlight DISA STIG and click on
Select profile
It will issue some errors, you can disregard them as we will correct it in the next section. Click Done - Installation Destination: For
Storage Configuation
selectCustom
. Click Done This will bring you to the manual partitioning page. - Manual Partitioning: Add all the following
DATA
andSYSTEM
mount points. - Click on
Modify
underVolume Group
and select "As large as possible" forSize policy
. Click Save then click Done - Accept Partitioning Changes: Click on Accept Changes
- Begin Installation: Click on Begin Installation to start installing AlmaLinux.
Congratulations you have installed AlmaLinux
Windows:
-
Open the Settings panel, then click Apps.
-
Under the Apps and Features heading, click Optional Features.
-
Scroll down the list to see if OpenSSH Client is listed.
- If it’s not, click the plus-sign next to Add a feature.
- Scroll through the list to find and select OpenSSH Client.
- Finally, click Install.
- If it’s not, click the plus-sign next to Add a feature.
-
Open Command Prompt.
- Press the Windows key.
- Type
cmd
. - Under Best Match, right-click Command Prompt.
- Click
Run as administrator
-
If prompted, click Yes in the Do you want to allow this app to make changes to your device? pop-up.
-
Use OpenSSH to Generate an SSH Key Pair
- In the command prompt, type the following:
ssh-keygen
- By default, the system will save the keys to C:\Users\your_username/.ssh/id_rsa. You can use the default name, or you can choose more descriptive names. This can help distinguish between keys, if you are using multiple key pairs. To stick to the default option, press Enter.
- You’ll be asked to enter a passphrase. Hit Enter to skip this step.
- The system will generate the key pair, and display the key fingerprint and a randomart image.
- Open your file browser.
- Navigate to C:\Users\your_username/.ssh.
- You should see two files. The identification is saved in the id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair.
- In the command prompt, type the following:
Linux:
In your preferred terminal run the command ssh-keygen
- By default, the system will save the keys to
~/.ssh
. - You should see two files. The identification is saved in the id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair.
MacOS:
In Terminal run the command ssh-keygen
- By default, the system will save the keys to
/Users/myname/.ssh
. - You should see two files. The identification is saved in the id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair.
mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Replace $SSH with the content of the public key.
echo "$SSH" >> ~/.ssh/authorized_keys
cd /etc/ssh
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' sshd_config
systemctl restart sshd
sudo su -
visudo
Press Insert
on keyboard, substitute $USER
with the user you created during installation.
$USER ALL=(ALL) NOPASSWD: ALL
Press esc
then type
:wq
This will save and close the terminal.
fapolicyd starts in protection mode. We need to set fapolicyd to permissive mode to allow us to build the necessary rule sets for our individual systems.
cd /etc/fapolicyd/
sed -i 's/permissive = 0/permissive = 1/g' fapolicyd.conf
systemctl restart fapolicyd
See RHEL: Blocking and Allowing applications with fapolicyd for more information on building rules.
As of current GnuTLS is not properly working with FIPS. To correct this we tell GnuTLS to disable health checks.
export GNUTLS_SKIP_FIPS_INTEGRITY_CHECKS=1
# Lets make is persistant
cd /etc/profile.d/
touch gnutls.sh
echo "export GNUTLS_SKIP_FIPS_INTEGRITY_CHECKS=1" > gnutls.sh
wget
will now function as intended.
cloud-init
: Cloud images are operating system templates and every instance starts out as an identical clone of every other instance. It is the user data that gives every cloud instance its personality and cloud-init is the tool that applies user data to your instances automatically.
dnf install -y cloud-init
cloud-utils-growpart
: Provides the growpart script for growing a partition. It is primarily used in cloud images in conjunction with the dracut-modules-growroot package to grow the root partition on first boot.
dnf install -y cloud-utils-growpart
gdisk
: GDISK command is used to partition the drives of your system. Works with cloud-init for partition resizing.
dnf install -y gdisk
Distributed under the MIT License. See LICENSE
for more information.
Twitter - @skynetinctech
Linkedin - Charles Showalter
Instagram - @skynetinc.tech
Facebook - @skynetinctech
Project Link: https://lab.skynetinc.tech/WorldDrknss/Guide-to-AlmaLinux/