Basic Fedora 31+ Installation: Difference between revisions

From WilliamsNet Wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
== Fedora Distribution Install ==
== Fedora Distribution Install ==
Fedora 31 KDE Workstation install from DVD install disk
Fedora 31 install from DVD install disk - this process should work for most (if not all) the variants of Fedora (Workstation, server, KDE Plasma).
 
During install process:
During install process:
* use custom formatting
* use custom formatting
* set partition type to 'standard'
* set partition type to 'standard'
* click on 'automatically create partitions
* click on 'automatically create partitions'
* delete /home partition and increase size of / to fill the disk
* delete /home partition and increase size of / to fill the disk
* change all filesystem types to 'xfs'
* set hostname (if known)  
* set hostname (if known)  
* enable all basic network interfaces (do not rename -- it will crash the installer)
* enable all basic network interfaces (do not rename -- it will crash the installer)


== Basic system prep ==
== Basic system prep ==
Many of these packages are already installed, but they are needed later, so we just make sure ...
Most of the initial configuration is now contained in a script that can be executed directly from the config server as root on the target system:
yum -y install net-tools rsync zsh yum-utils mlocate drpm
 
yum -y install sshfs nfs-utils ssmtp psmisc
curl -s http://config/config/fedora-basic-config.sh | bash
yum -y remove firewalld postfix esmtp
 
  yum -y update
The contents of this script are included here for reference:
 
<pre>#!/bin/sh
#
# script to do the basic install of a centos7 headless server
#
# Assumptions:
#  - this is run as root immediately after the install has completed
#  - the hostname has been set as desired before this script is run
#  - an administrator account 'ewilliam' was created during installation
 
CONFIG=http://kube202/config
 
# first -- install all the basic necessities (some may already be there)
yum -y install net-tools rsync zsh epel-release yum-utils mlocate drpm
yum -y install sshfs nfs-utils ssmtp psmisc
yum -y remove firewalld postfix
 
# Enable automatic updates. 
# Parameters can be set in the config files '/etc/dnf/automatic.conf'
yum -y install dnf-automatic
systemctl enable --now dnf-automatic.timer
 
# now get all the updates
yum -y update
 
# now disable SELinux (no comment)
sed -i 's/=enforcing/=disabled/g' /etc/selinux/config
setenforce 0
 
# Enable the SSH server (why it's not enabled by default is strange ...)
systemctl enable --now sshd
 
# make sudo passwordless for group wheel
echo "%wheel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/91-wheel-NOPASSWD
 
# now that zsh is installed, make it the default
chsh -s /bin/zsh
chsh -s /bin/zsh ewilliam
 
# copy the standard zsh config files
curl -s $CONFIG/centos7/.zshrc -o /root/.zshrc
curl -s $CONFIG/centos7/.zshrc -o /home/ewilliam/.zshrc
chown ewilliam.ewilliam /home/ewilliam/.zshrc


Disable SELinux (no comment)
# load ssh known_hosts from the config server
sed -i 's/=enforcing/=disabled/g' /etc/selinux/config
mkdir -p /root/.ssh
setenforce 0
curl -s $CONFIG/ssh/known_hosts -o /root/.ssh/known_hosts
mkdir -p /home/ewilliam/.ssh
curl -s $CONFIG/ssh/known_hosts -o /home/ewilliam/.ssh/known_hosts
chown -R ewilliam.ewilliam /home/ewilliam/.ssh


Enable passwordless sudo:
# get backup scripts
* use visudo
curl -s $CONFIG/centos7/backup -o /etc/cron.daily/backup
* search for 'wheel'
curl -s $CONFIG/centos7/rsync_backup.sh -o /usr/local/bin/rsync_backup.sh
* comment out that line
chmod +x /usr/local/bin/rsync_backup.sh
* uncomment the one below it


Set '''zsh''' as the default shell
# configure log server
* chsh to /bin/zsh (both root and ewilliam)
curl -s $CONFIG/centos7/99-remotelog.conf -o /etc/rsyslog.d/99-remotelog.conf
* copy '''ssh''' and '''zsh''' config files (both root and ewilliam)
systemctl restart rsyslog
  scp -r calormen:.ssh .
  scp calormen:.zshrc .
  scp calormen:.zlogin .


Enable the SSH server (why it's not enabled by default is strange ...)
# enable mail to the central email server
systemctl enable --now sshd
echo "root: ewilliam@williams.localnet" >> /etc/aliases
echo "ewilliam: ewilliam@williams.localnet" >> /etc/aliases


Enable automatic updates.  Parameters can be set in the config files '/etc/dnf/automatic.conf'
# get the standard /etc/hosts file
yum -y install dnf-automatic
curl $CONFIG/hosts -o /etc/hosts
systemctl enable --now dnf-automatic.timer


Setup backup to central file server
# now reboot
* copy scripts from calormen
reboot</pre>
scp calormen:/etc/cron.daily/backup /etc/cron.daily
scp calormen:/usr/local/bin/rsync_backup.sh /usr/local/bin/
* edit rsync_backup.sh, changing target directory and list of directories to backup
* create target directory on storage1 if it doesn't exist
* run /etc/cron.daily/backup to verify proper operation


Enable connection to the central log server scp aslan:/etc/hosts /etc/hosts
== Final Configuration ==
The only remaining task is to load the ssh credentials for '''root''' and any user accounts.  This is done by running the following command from each user account (assuming aslan is the reference source):


  scp calormen:/etc/rsyslog.d/99-remotelog.conf /etc/rsyslog.d ; systemctl restart rsyslog
  scp -r aslan:.ssh $HOME


Enable mail to central mail server; SSMTP package is not yet in the CentOS 8 epel repo, so we need to 'borrow' it from CentOS 7
This can also be pushed from aslan to the new system for each account:
# download ssmtp RPM from somewhere
wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/ssmtp-2.64-14.el7.x86_64.rpm
yum -y install ssmtp-2.64-14.el7.x86_64.rpm
echo "root: ewilliam@williams.localnet" >> /etc/aliases
echo "ewilliam: ewilliam@williams.localnet" >> /etc/aliases


enable references to non-williamsnet addresses for development cluster
  scp -r ~/.ssh <new_host>:
  scp aslan:/etc/hosts /etc/hosts


Reboot and verify everything comes up properly
Passwords will be required for this action, but (if the copy is successful) no further passwords will be needed by ssh.
reboot

Revision as of 21:13, 29 November 2020

Fedora Distribution Install

Fedora 31 install from DVD install disk - this process should work for most (if not all) the variants of Fedora (Workstation, server, KDE Plasma).

During install process:

  • use custom formatting
  • set partition type to 'standard'
  • click on 'automatically create partitions'
  • delete /home partition and increase size of / to fill the disk
  • change all filesystem types to 'xfs'
  • set hostname (if known)
  • enable all basic network interfaces (do not rename -- it will crash the installer)

Basic system prep

Most of the initial configuration is now contained in a script that can be executed directly from the config server as root on the target system:

curl -s http://config/config/fedora-basic-config.sh | bash

The contents of this script are included here for reference:

#!/bin/sh
#
# script to do the basic install of a centos7 headless server
#
# Assumptions:
#  - this is run as root immediately after the install has completed
#  - the hostname has been set as desired before this script is run
#  - an administrator account 'ewilliam' was created during installation

CONFIG=http://kube202/config

# first -- install all the basic necessities (some may already be there)
yum -y install net-tools rsync zsh epel-release yum-utils mlocate drpm
yum -y install sshfs nfs-utils ssmtp psmisc
yum -y remove firewalld postfix

# Enable automatic updates.  
#  Parameters can be set in the config files '/etc/dnf/automatic.conf'
yum -y install dnf-automatic
systemctl enable --now dnf-automatic.timer

# now get all the updates
yum -y update

# now disable SELinux (no comment)
sed -i 's/=enforcing/=disabled/g' /etc/selinux/config
setenforce 0

# Enable the SSH server (why it's not enabled by default is strange ...)
systemctl enable --now sshd

# make sudo passwordless for group wheel
echo "%wheel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/91-wheel-NOPASSWD

# now that zsh is installed, make it the default
chsh -s /bin/zsh
chsh -s /bin/zsh ewilliam

# copy the standard zsh config files
curl -s $CONFIG/centos7/.zshrc -o /root/.zshrc
curl -s $CONFIG/centos7/.zshrc -o /home/ewilliam/.zshrc
chown ewilliam.ewilliam /home/ewilliam/.zshrc

# load ssh known_hosts from the config server
mkdir -p /root/.ssh
curl -s $CONFIG/ssh/known_hosts -o /root/.ssh/known_hosts
mkdir -p /home/ewilliam/.ssh
curl -s $CONFIG/ssh/known_hosts -o /home/ewilliam/.ssh/known_hosts
chown -R ewilliam.ewilliam /home/ewilliam/.ssh

# get backup scripts
curl -s $CONFIG/centos7/backup -o /etc/cron.daily/backup
curl -s $CONFIG/centos7/rsync_backup.sh -o /usr/local/bin/rsync_backup.sh
chmod +x /usr/local/bin/rsync_backup.sh

# configure log server
curl -s $CONFIG/centos7/99-remotelog.conf -o /etc/rsyslog.d/99-remotelog.conf
systemctl restart rsyslog

# enable mail to the central email server
echo "root: ewilliam@williams.localnet" >> /etc/aliases
echo "ewilliam: ewilliam@williams.localnet" >> /etc/aliases

# get the standard /etc/hosts file
curl $CONFIG/hosts -o /etc/hosts

# now reboot
reboot

Final Configuration

The only remaining task is to load the ssh credentials for root and any user accounts. This is done by running the following command from each user account (assuming aslan is the reference source):

scp -r aslan:.ssh $HOME

This can also be pushed from aslan to the new system for each account:

scp -r ~/.ssh <new_host>:

Passwords will be required for this action, but (if the copy is successful) no further passwords will be needed by ssh.