# Linux Server - Install RedHat 9.4

## <span style="font-family: 'Verdana',sans-serif;">Summary</span>

Instructions on the install and configuration of a Linux server for Kiwiplan.


### <span style="font-family: 'Verdana',sans-serif;">Details</span>

#### <span style="font-family: 'Verdana',sans-serif;">Prerequisites</span>

VMware, KVM, Hyper-V machine to host the installation

You will need to use the following command when you vi your files as you cut and paste:

Once in vi you have to hit the colon and then type “set paste”

```shell
:set paste
```

This will not mess with the paste you put in.

### <span style="font-family: 'Verdana',sans-serif;">Instructions</span><span style="font-family: 'Verdana',sans-serif;"> </span>

### <span style="font-family: 'Verdana',sans-serif;">Preparing the OS</span>

This is to install the OS on a VmWare

### VMWare Setup using GUI

Boot ISO

<span style="mso-no-proof: yes;">![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-ltdtgeuy.png)  
</span>

Select “Install RedHat Linux”

<span style="mso-no-proof: yes;">![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-ojdwsbzd.png)  
</span>

Select Language

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-bv14qs1z.png)

Then Select “Network &amp; Hostname” from install menu.

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-wktqyqv5.png)

Set hostname and hit apply

Click Configure and set the IP

Click on IPv6 Settings and disable it

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-2bgknu9x.png)

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-nlyq4g2s.png)

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-kk33rltw.png)

Select “Installation Destination”

Make sure you select custom to configure the drives and click done

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-g2dru1qf.png)

Click on the blue link to auto configure them

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-uczupyoe.png)

Make sure the /home drive is highlighted and click the “-“ minus sign to remove that drive

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-typbmqb8.png)

Add the pink value of the space available after the delete of the home folder.

Enter “350 GiB” (total of drive space you created for the VM), this will recalculate the size of the drive and then hit “Done”.

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-no2h8bta.png)

Hit “Accept Changes”

Click on the “Root Password” and click “Allow root SSH login with password” and then click “Done”

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-vfrd0ol9.png)

Click “Connect to Redhat”

Enter you Account details unless you are building a **VM template**, if not then select the purpose of the server then click on “Register”

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-rbn4lter.png)

Click on “Done”

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-ou5o3zxp.png)

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-jxjdokvd.png)

Click “Software Selection” and select “Minimal Install”

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-gg58z1ai.png)

Click “Begin Installation”

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-xnrqxiaj.png)

When finished click on “Reboot System”


### Network Text GUI

Login with root

NOTE: Run # nmtui **Only if you did not do the GUI version**

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-i82xhbvl.png)

Select Edit connection

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-tfcolava.png)

Select interface and hit enter

![](https://docs.sflservicesllc.com/uploads/images/gallery/2024-09/embedded-image-rcsmwabt.png)

Use arrows to navigate

IPV4 change to manual and select show, fill in the information

IPV6 Change to disabled, press OK

Highlight Automatically connect and press the space bar

press OK

Start setup Instructions for RedHat Linux


### Connect to the Server

Use a SSH connection to the server the remaining of the commands in order to cut and pates them in instead of using the VM interface.

### <span style="font-family: 'Verdana',sans-serif;">Commands to run</span>

This will show all command that need to be ran to update within the OS to start the configuration.

All the command are within each box

#### Update the System

After install update system packages for the needed configuration.

```shell
dnf upgrade -y
```

<span lang="ES-MX" style="mso-ansi-language: ES-MX;">Disable SeLinux</span>

```shell
setenforce 0
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
```

File is located here if you wish to edit manually

```shell
vi /etc/sysconfig/selinux
```

<span lang="ES-MX" style="mso-ansi-language: ES-MX;"> </span>Disable firewall

```shell
systemctl disable firewalld.service
```

Epel Release

```shell
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
```

After Epel installation rerun the upgrade to update if any are needed

```shell
dnf upgrade -y
```


## Install core software

### Install Packages

#### Add the needed packages

Install required system packages

```shell
dnf install bind-utils bzip2 cups cifs-utils enscript ftp gdb ghostscript java-1.8.0-openjdk-headless java-11-openjdk-headless krb5-workstation ksh lftp lrzsz lsof libnsl lzop mlocate mutt ncompress net-tools net-snmp net-snmp-utils net-tools nfs-utils nmap nvme-cli openldap-clients openssh-clients psmisc realmd rsync samba-client strace sysstat tcpdump telnet telnet-server tmux unix2dos vim vim-enhanced vsftpd wget xfsdump vsftpd htop mc rsyslog rsyslog-doc postfix dbus-daemon s-nail dovecot cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain tree figlet toilet coreutils -y
```

If you are running on a virtual machine run the following

```shell
dnf install open-vm-tools -y
sysctl vm.swappiness=10
```

Install vim color for scripting

```shell
dnf install git -y
git clone https://github.com/flazz/vim-colorschemes ~/.vim/
cp ~/.vim/colors/desert.vim /etc/vimrc.local
```


### Configure Installed Packages

#### Configure the packages

Enable Telnet run the following to enable and start the packages

```shell
systemctl enable telnet.socket
systemctl restart telnet.socket
```

<p class="callout warning">**ONLY CHANGE FOR OLDER SSH ALGORYTHM IF NEEDED FOR LEGACY DEVICES**</p>

[Legacy ssh connections](https://docs.sflservicesllc.com/books/linux/page/linux-server-install-redhat-9-ssh-configuration "Legacy ssh connections")

<p class="callout info">**CONTINUE HERE IF SSH LEGACY IS NOT NEEDED**</p>

Enable Time Synchronization run the the following and add your domain time server

```shell
vi /etc/chrony.conf
```

Add your server below the following and make sure you change the domain name from **sflservicesllc.com**

```shell
# These servers were defined in the installation:
#server _gateway iburst
server domain.sflserviesllc.com iburst prefer
```

Enable Time Synchronization

```shell
systemctl enable --now chronyd
```

Note: Time-zone changes are made with the<span class="st"> command</span>

```shell
timedatectl
```

<span style="mso-bidi-font-family: 'Courier New';">Make the following changes within the file</span>

```shell
sudo sed -i 's/^anonymous_enable=.*/anonymous_enable=NO/' /etc/vsftpd/vsftpd.conf
sudo sed -i 's/^local_umask=.*/local_umask=002/' /etc/vsftpd/vsftpd.conf
sudo sed -i 's/^#ascii_upload_enable=.*/ascii_upload_enable=YES/' /etc/vsftpd/vsftpd.conf
sudo sed -i 's/^#ascii_download_enable=.*/ascii_download_enable=YES/' /etc/vsftpd/vsftpd.conf
```

Start and Enable FTP for transfer in and out for us or other vendors

```shell
systemctl enable --now vsftpd.service
```

<p class="callout warning">**ONLY CHANGE THE FOLLOWING IF YOU HAVE REMOTE LOGGING**</p>

If you have a remote logging server setup then edit the following command

```shell
vi /etc/rsyslog.conf
```

Then add the following at the end of the file but make sure you update the IP address and replace the XXX's

```shell
*.* @192.168.XXX.XXX:514   # use @ for UDP Protocal
*.* @@192.168.XXX.XXX:514   # use @@ for TCP Protocal
auth.* @192.168.XXX.XXX:514 # only for authentication based records
```

Optional: you can change this and run to add at the end

```
echo -e "*.* @192.168.253.70:514 # use @ for UDP Protocal\n*.* @@192.168.253.70:514 # use @@ for TCP Protocal\nauth.* @192.168.253.70:514 # only for authentication based records" | sudo tee -a /etc/rsyslog.conf
```

<p class="callout info">**CONTINUE HERE IF NOT REMOTE LOGGING**</p>

Enable Rsyslog to enable logging locally and remotely

```shell
systemctl enable --now rsyslog
```

Backup the original file

```shell
cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
vi /etc/postfix/main.cf
```

Configure Postfix for Email run the following

```shell
vi /etc/postfix/main.cf
```

<span lang="FR-CA" style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: FR-CA;">Update the following with your email server</span>

```shell
relayhost = [ENTER IP or SMTP SERVER] or [sflservicesllc-com.mail.protection.outlook.com]:25
```

<p class="callout warning">**<span lang="FR-CA" style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: FR-CA;">OPTIONAL IF YOU WANT TO HARDCODE A DOMAIN NAME (Server not attached to AD)</span>**</p>

<span lang="FR-CA" style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: FR-CA;">Update the following with a remote or local email server and make sure you change the domain name from **sflservicesllc.com**</span>

```shell
myhostname = sflservicesllc.com

mydomain = sflservicesllc.com

mydestination = $myhostname, localhost.$mydomain, localhost

relayhost = [ENTER IP or SMTP SERVER] or [sflservicesllc-com.mail.protection.outlook.com]:25
```

<p class="callout info">CONTINUE HERE IF NO NEED FOR HARDCODED DOMAIN</p>

<p class="callout warning">**OPTIONAL IF YOU HAVE NO EMAIL SERVER**</p>

Update the following for no email server and make sure you change the domain name from **sflservicesllc.com** and only allow certain networks

```
myhostname = sflservicesllc.com

mydomain = sflservicesllc.com

mail_spool_directory = /var/mail

mynetworks = 127.0.0.0/8, 168.100.189.0/28
```

<p class="callout info">CONTINUE HERE IF YOU HAVE A EMAIL SERVER</p>

Enable Postfix

```shell
systemctl enable --now postfix
```

Test your config this way

```shell
echo "Install of Linux Rocks $HOSTNAME" | sendmail steve.ling@sflservicesllc.com
```

<span lang="FR-CA" style="mso-ansi-language: FR-CA;">Locale add-ons to make sure that ANSI applications display correctly so e</span><span lang="FR-CA" style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: FR-CA;">dit the following and replace all of the values with the following</span>

<span lang="FR-CA" style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: FR-CA;">Edit the following:</span>

```shell
sudo cat > /etc/locale.conf << EOF
LANG="en_US"
SUPPORTED="en_GB:en_GB-.UTF-8:en_US:en_US.UTF-8:de_DE:de_DE.UTF-8"
SYSFONT="latarcyrheb-sun16"
EOF
```

<p class="callout info">**ONCE ADDED THE ABOVE CONFIGURATION THEN EXIT AND LOG BACK IN**</p>

### Bash colors and Prompt

Bash for root for color edit the following:

Dependent on

```bash
dnf install figlet toilet -y
```

Creating Aliases

```bash
sudo cat > /etc/profile.d/custom-aliases.sh << EOF
# Common interactive aliases for all users

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vi='vim'
alias tailf='tail -f'
EOF
```

Server Warning

```bash
sudo tee /etc/profile.d/custom-prod-warning.sh > /dev/null << 'EOF'
# Colorful PRODUCTION warning banner for interactive logins

if [[ -n "$PS1" && -t 0 && -t 1 ]]; then  # Interactive terminal with stdin/stdout
    RED='\033[1;31m'   # Bold red
    YELLOW='\033[1;33m' # Bold yellow
    NC='\033[0m'       # No color

    echo
    if command -v figlet >/dev/null 2>&1; then
        figlet -f big "PRODUCTION" | while IFS= read -r line; do
            printf '%b%s%b\n' "$RED" "$line" "$NC"
        done
        figlet -f big "SERVER" | while IFS= read -r line; do
            printf '%b%s%b\n' "$RED" "$line" "$NC"
        done
    else
        echo -e "${RED}***** PRODUCTION SERVER!! *****${NC}"
    fi

    echo
    echo -e "${YELLOW} *** EXTREME CAUTION REQUIRED ***${NC}"
    echo -e "${RED}This is a LIVE PRODUCTION system.${NC}"
    echo -e "${RED}Unauthorized access is strictly prohibited.${NC}"
    echo -e "${RED}All activity is logged and monitored.${NC}"
    echo -e "${YELLOW}Think twice before running commands!${NC}"
    echo

    # Pause briefly to ensure user sees the warning
    read -t 5 -p "Press Enter to continue (auto-continue in 5 seconds)... " || true
    echo
fi
EOF
```

Creating Colorful Prompts

```bash
sudo tee /etc/profile.d/custom-prompt-and-colors.sh > /dev/null << 'EOF'
# Custom LS_COLORS and improved multi-line colored prompt

# Vibrant LS_COLORS (directories bold blue on gray, etc.)
LS_COLORS='rs=0:di=01;44:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
export LS_COLORS

# Color and style variables (cached tput calls for speed)
RESET=$(tput sgr0)
BOLD=$(tput bold)
BG_GRAY=$(tput setab 8)
FG_RED=$(tput setaf 1)
FG_MAGENTA=$(tput setaf 5)
FG_GREEN=$(tput setaf 2)
FG_CYAN=$(tput setaf 6)

# Multi-line prompt
PS1="\n${BOLD}${BG_GRAY}${FG_RED}\\u${FG_MAGENTA}@${FG_RED}\`hostname\`${FG_GREEN} : \`uname\` : ${FG_CYAN}\\d \\t : \${PLANTID:+\$PLANTID }\n${FG_CYAN}[\\w]${RESET}${BOLD} \\\$ ${RESET}"
export PS1
EOF
```


### <span class="st">Database Install and Configuration</span>

### Configure MariaDB

<p class="callout info">**OPTIONAL ADD THE MARIADB REPO TO GET THE LATES REVISION**</p>

<p class="callout danger">**MARIADB REPORTED A PROBLEM WITH 10.5, YOU SHOULD CONSIDER UPGRADING TO 10.11**</p>

Install the new Repo for MariaDB

```bash
curl -sLS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
```

This is the location of

```bash
cat /etc/yum.repos.d/mariadb.repo
```

You have to change the yellow below to get the desired version

<p class="callout warning">10.11 Revision</p>

<table border="1" id="bkmrk-%5Bmariadb-main%5Dname-%3D" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>\[mariadb-main\]  
name = MariaDB Server  
baseurl = https://dlm.mariadb.com/repo/mariadb-server/<span style="color: rgb(241, 196, 15);">10.11</span>/yum/rhel/9/x86\_64  
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY  
gpgcheck = 1  
enabled = 1  
module\_hotfixes = 1

  
\[mariadb-maxscale\]  
\# To use the latest stable release of MaxScale, use "latest" as the version  
\# To use the latest beta (or stable if no current beta) release of MaxScale, use "beta" as the version  
name = MariaDB MaxScale  
baseurl = https://dlm.mariadb.com/repo/maxscale/latest/yum/rhel/9/x86\_64  
gpgkey = file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY  
gpgcheck = 1  
enabled = 1

</td></tr></tbody></table>

You will have to remove the current one installed if it exists and then install the new one

```bash
dnf remove mariadb-server
dnf install mariadb-server
```

Run the following to edit the service file

```shell
systemctl edit mariadb.service
```

Then add the following to the file in between these lines

```shell
### Editing /etc/systemd/system/mariadb.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
LimitNOFILE=32768

### Lines below this comment will be discarded
```

Run the following

```shell
vi /etc/my.cnf.d/client.cnf
```

Add the following below the **\[client\]** section

```shell
socket=/var/lib/mysql/mysql.sock
```

Run the following

```bash
vi /etc/my.cnf.d/server.cnf
```

Add the following below the **\[mysqld\]** section and you will have to use the **:set paste** command or it will not paste correctly

<p class="callout warning">BELOW IS FOR SERVER 8CPU AND 64GIG MEMORY</p>

```shell
#Custom
performance_schema = ON
tmpdir = /run/mariadb
thread_cache_size = 4
table_open_cache = 16384
table_definition_cache = 8384
sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

query_cache_type = 0
query_cache_size = 0
query_cache_limit = 128M
query_cache_strip_comments = 1

tmp_table_size = 512M
max_heap_table_size = 512M

max_connections = 750
max_allowed_packet = 24M
sort_buffer_size = 24M
join_buffer_size = 48M

innodb_buffer_pool_size = 48G           # 65-75% of RAM for InnoDB cache --> Keeping some for VUE
innodb_buffer_pool_instances = 6        # One instance per CPU core --> Keeping some for VUE 2 out of 8
innodb_flush_method = O_DIRECT          # Reduce I/O overhead
innodb_flush_log_at_trx_commit = 2      # Balance performance and durability
innodb_log_buffer_size = 16M            # Buffer for transaction logs
innodb_thread_concurrency = 0           # Let MySQL manage threads (0 = unlimited)
innodb_io_capacity = 2000               # Adjust based on storage IOPS
innodb_io_capacity_max = 4000           # Max IOPS for bursts
innodb_use_native_aio = 1
innodb_flush_log_at_trx_commit = 2      # Balance performance and durability --> Changed from 0
innodb_file_per_table
innodb_log_file_size = 2G               # Larger logs for better write performance --> Changed from 512

#Optional configuration for transaction logging Change for mysql or mariadb
#log_bin = /var/log/mariadb/mariadb.log
#expire_logs_days = 2
```

Reload the changes

```shell
systemctl daemon-reload
```

Enable and start MySQL/MariaDB on boot

```shell
systemctl enable --now mariadb.service
```

Run the following

```shell
mysql
```

Then execute the following statements also make sure to<span style="mso-spacerun: yes;"> </span>(**<u>change passwords as needed XXXXXXXXXX but NOT the users names</u>**)

```shell
CREATE USER 'kiwisql'@'%' IDENTIFIED BY 'XXXXXXXXXX';
GRANT all ON *.* TO 'kiwisql'@'%' WITH GRANT OPTION;
CREATE USER 'kiwisql'@'localhost' IDENTIFIED BY 'XXXXXXXXXX';
GRANT all ON *.* TO 'kiwisql'@'localhost' WITH GRANT OPTION;
CREATE USER 'kiwilive'@'localhost' IDENTIFIED BY 'XXXXXXXXXX';
GRANT all ON *.* TO 'kiwilive'@'localhost';
CREATE USER 'remuser'@'localhost' IDENTIFIED BY 'XXXXXXXXXX';
GRANT all ON *.* TO 'remuser'@'localhost' WITH GRANT OPTION;
CREATE USER 'reports'@'%' IDENTIFIED BY 'XXXXXXXXXX';
GRANT SHOW DATABASES, SELECT, EXECUTE, PROCESS, SHOW VIEW  ON *.* TO 'reports'@'%';
FLUSH PRIVILEGES;
Quit
```


### Build skeleton for the Kiwiplan Environment

### Command to Run

Setup the user environment

Remember to change the **remuser** &amp; **esp** password

ESP username password is the global password store in ESP to let it connect and is *<span style="text-decoration: underline;">unfortunately </span>*visible to an admin user but please make sure to (**<u>change passwords as needed XXXXXXXXXX but NOT the users names</u>**)

```
groupadd kiwiplan
mkdir /opt/kiwi
ln -s /opt/kiwi/ /KIWI
mkdir /opt/kiwi/{home,rev}
mkdir /opt/kiwi/rev/{map,mes}
useradd -g kiwiplan -G wheel -d /KIWI/home/remuser/ remuser
echo XXXXXXXXXX | passwd --stdin remuser
useradd -g kiwiplan -d /KIWI/home/esp/ esp
echo XXXXXXXXXX | passwd --stdin esp
chown -R remuser:kiwiplan /opt/kiwi
mkdir /etc/kiwiplan
chown remuser:kiwiplan /etc/kiwiplan
```


### <span class="st"><span lang="FR-CA" style="mso-ansi-language: FR-CA; mso-bidi-font-weight: bold;">Systemd Socket Implementation For KIDD</span></span>

### <span lang="FR-CA" style="mso-ansi-language: FR-CA;">Configure kidd.stocket</span>

Remember your **:set paste** command

Create a socket file and the following

```shell
vi /lib/systemd/system/kidd.socket
```

Then add the following

```shell
[Unit]
Description=KIDD
[Socket]
ListenStream=2326
Accept=yes

[Install]
WantedBy=sockets.target
```

Create a service file by editing the following

```shell
vi /lib/systemd/system/kidd@.service
```

Then add the following

```shell
[Unit]
Description=Kidd Server
[Service]
ExecStart=/KIWI/rev/current/progs/kidd -a -p -F 1
User=root
Group=root
StandardInput=socket
StandardOutput=socket

# Resource configuration
LimitNOFILE=8192
LimitNPROC=4096

# MaxConnections=nnn - The maximum number of connections to simultaneously run services instances for
#  when Accept=true is set. nnn should be sized accordingly for the implementation.
MaxConnections=200

# The maximum number of connections for a service per source IP address. 
# This is very similar to the MaxConnections= directive above. Disabled by default.
MaxConnectionsPerSource=80
```

Start the service and enable on reboot

```shell
systemctl start kidd.socket
systemctl enable kidd.socket
```

This will only work once you have the Kiwiplan environment configured/installed

### <span class="st"><span style="mso-bidi-font-weight: bold;">VUE Installation Configurations</span></span>

### <span class="st"><span style="mso-bidi-font-weight: bold;">Adjust system limits for VUE products</span></span>

<span class="st">Edit the following</span>

```shell
vi /etc/security/limits.d/20-nproc.conf
```

<span class="st">Add the following </span>

```shell
@kiwiplan  soft     nproc     32768
```

<span class="st">Edit the following </span>

```shell
vi /etc/security/limits.conf
```

<span class="st">Then add the following before the **\#End of file**</span>

```shell
@kiwiplan     -     nofile     32768
```


### Installing MsSQL Tool

#### Configure MsSQL tools

Install the repo for the MsSQL service/connection

```shell
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/msprod.repo
```

This will only work once you have the Kiwiplan environment configured/installed

Install the packages make sure you answer/type **YES** to all

```shell
dnf remove mssql-tools unixODBC-utf16-devel
dnf install mssql-tools unixODBC-devel -y
```

## STOP HERE FOR YOUR TEMPLATE BUILD



## RESTART FROM HERE AFTER TEMPLATE BUILD

#### Linux RedHat Registration

Re-Register the server with RedHat if you entered initial credentials to add the server

You need to run the **nmtui** command to bring up the menu from above in this documentation and then simply change the IP and also the hostname

Run the following and this will change the subscription details

```shell
subscription-manager register --force
subscription-manager attach --auto
```

### <span class="st"><span style="mso-bidi-font-weight: bold;">Activate Directory Setup</span></span>

#### <span class="st">Using SSSD</span>

Install the following packages

```shell
yum install sssd sssd-tools realmd samba-common-tools oddjob oddjob-mkhomedir adcli samba -y
```

Run this just in-case your domain is still using RC4

```shell
update-crypto-policies --set DEFAULT:AD-SUPPORT
```

#### Configure KRB5

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Edit the following file and make sure the following is added/changed</span>

```shell
vi /etc/krb5.conf
```

Add or changed the following below

<table border="1" id="bkmrk-%23-to-opt-out-of-the-" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>\# To opt out of the system crypto-policies configuration of krb5, remove the  
\# symlink at /etc/krb5.conf.d/crypto-policies which will not be recreated.  
includedir /etc/krb5.conf.d/

\[logging\]  
 default = FILE:/var/log/krb5libs.log  
 kdc = FILE:/var/log/krb5kdc.log  
 admin\_server = FILE:/var/log/kadmind.log

\[libdefaults\]  
 dns\_lookup\_realm = <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">true</span>  
 ticket\_lifetime = 24h  
 renew\_lifetime = 7d  
 forwardable = true  
 rdns = <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">true</span>  
 pkinit\_anchors = FILE:/etc/pki/tls/certs/ca-bundle.crt  
 spake\_preauth\_groups = edwards25519

<span data-darkreader-inline-color="" style="font-family: Consolas;"><span style="mso-spacerun: yes;"> </span>dns\_canonicalize\_hostname = fallback</span>

<span data-darkreader-inline-color="" style="font-family: Consolas; color: rgb(241, 196, 15);"><span style="mso-spacerun: yes;"> </span></span><span data-darkreader-inline-color="" style="font-family: Consolas;">qualify\_shortname = ""</span>

 default\_realm = <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">ONLING.COM</span>  
 default\_ccache\_name = KEYRING:persistent:%{uid}  
 <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">udp\_preference\_limit = 0</span>

\[realms\]  
 <span style="color: rgb(241, 196, 15);">ONLING.COM </span>= {  
 kdc = <span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman';"><span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">domain\_controller.</span></span><span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">.onling.com</span>  
 admin\_server = <span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman';"><span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">domain\_controller.</span></span><span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">.onling.com</span>  
 }

\[domain\_realm\]  
<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);"> .onling.com = ONLING.COM</span>  
<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);"> onling.com = ONLING.COM</span>

</td></tr></tbody></table>

#### Join the server to the domain

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Configurating the SSSD (in <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">yellow </span>update to site specific) (in <span data-darkreader-inline-color="" style="color: rgb(45, 194, 107);">green </span>needs to be capitalized)</span>

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">You must have the access to add to the AD server or the server has to be add first before you run the following command.</span>

<p class="callout warning"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">For the join you may need to specify the -OU's for the specific location</span></p>

<table border="1" id="bkmrk-realm-discover-onlin" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td><span lang="FR-CA" style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: FR-CA;">\# realm discover <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">onling.com</span></span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman';">\# realm join -U [<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">administrator</span>@<span data-darkreader-inline-color="" style="color: rgb(45, 194, 107);">ONLING.COM</span>](mailto:administrator@ONLING.COM) --verbose <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">domain\_controller.onling.com</span></span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">\# authselect select sssd with-mkhomedir </span>

<span style="font-size: 11.0pt; line-height: 107%; font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">\# authselect apply-changes</span></td></tr></tbody></table>

Copy from below and make changes

```shell
realm discover onling.com
realm join -U administrator@ONLING.COM --verbose domain_controller.onling.com
authselect select sssd with-mkhomedir
authselect apply-changes
```


#### <span style="mso-fareast-font-family: 'Times New Roman';">Update SSSD config</span>

Once joined then you can change or add the following parameters

```shell
vi /etc/sssd/sssd.conf
```

<table border="1" id="bkmrk-%C2%A0-%5Bsssd%5D-domains-%3D-o" style="border-collapse: collapse; width: 100%; height: 439.125px;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr style="height: 439.125px;"><td style="height: 439.125px;"><span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"> </span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">\[sssd\]</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">domains = onling.com</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">config\_file\_version = 2</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">services = nss, pam</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"> </span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">\[domain/onling.com\]</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">default\_shell = /bin/bash</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">ad\_server = sfl-dom-001.onling.com</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">krb5\_store\_password\_if\_offline = True</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">cache\_credentials = True</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">krb5\_realm = ONLING.COM</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">realmd\_tags = manages-system joined-with-adcli</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">id\_provider = ad</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">fallback\_homedir = <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">/home/%d/%u</span></span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">ad\_domain = onling.com</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">use\_fully\_qualified\_names = <span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">false</span></span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">ldap\_id\_mapping = True</span>

<span style="font-family: Consolas; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">access\_provider = ad<span data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="" style="background: yellow; mso-highlight: yellow;"> </span></span>

<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">override\_gid = 1000</span>  
<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">ad\_gpo\_ignore\_unreadable = true</span>  
<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">ad\_gpo\_access\_control = disabled</span>  
<span data-darkreader-inline-color="" style="color: rgb(241, 196, 15);">timeout = 300</span>

</td></tr></tbody></table>

Restarting SSSD

```shell
systemctl stop sssd; sss_cache -E; systemctl start sssd
```

### Stop Here

### Optional SSSD configurations

#### <span style="mso-fareast-font-family: 'Times New Roman';">Defaults to no Shell Access, allows short usernames</span>

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Optional (Group allow)</span><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"> additional parameters and changes</span>

<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" id="bkmrk-simple_allow_groups-" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 5.4pt 0in 5.4pt;"><tbody><tr style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes;"><td data-darkreader-inline-border-bottom="" data-darkreader-inline-border-left="" data-darkreader-inline-border-right="" data-darkreader-inline-border-top="" style="width: 561.1pt; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt;" valign="top" width="748"><span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">simple\_allow\_groups = sssd-users </span>

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">OR</span>

<span style="mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">simple\_allow\_groups = <span style="mso-spacerun: yes;"> </span>gg-C3193???-KiwiTS\_access</span>

</td></tr></tbody></table>

#### Add users to SSSD

Optional grant shell access and force primary group to kiwiplan, change john.doe to the username

```shell
sss_override user-add john.doe -g $(getent group kiwiplan | cut -d: -f3) -s /bin/bash -h /KIWI/home/john.doe
```