0 Votes

Linux

Last modified by Jeff McDonald on 2024/03/30 18:54

Here are some notes for installing and configuring Oracle Linux.
None of them are particularly clever, I just often forget the exact commands.

Installation

Disable Predictive Network Interface Names

The WSC-ME does not support Predictable Network Interface Names.

To disable it, during installation, upon the initial install screen, press TAB, and add the following parameter to the boot parameters:

net.ifnames=0

Example:

> vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=OL-7.2\x20Server.x86_64 rd.live.check quiet net.ifnames=0

Minimum Install

For Oracle products, always go with the minimum install (default).

Remember to:

  • Set the host name
  • Configure each network interface to "Automatically connect to this network when it is available"
  • Set the timezone and enable Network Time
  • Select the installation drive
  • Set root password

Network Installation

For Oracle 7: http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/

For Oracle 8: http://yum.oracle.com/​repo/​OracleLinux/​OL8/​baseos/​latest/​x86_64

Oracle YUM Server

Certain applications (like Docker) require authentication.

docker login container-registry.oracle.com

Screen Blanking

Screen blanking (on VMs) really annoys me. To turn of screen blanking from the console (not ssh):

setterm -powersave off -blank 0

Common User Modifications

The simplest way to give a user 'sudo' privileges is to add them to the 'wheel' group.

usermod -aG wheel <user>

Entering passwords every time I use 'sudo' annoys me.

Type 'visudo' to edit the 'sudoers' file. Comment out the regular line and uncomment the NOPASSWD line.

## Allows people in group wheel to run all commands
#%wheel  ALL=(ALL)            ALL
## Same thing without a password
%wheel   ALL=(ALL)  NOPASSWD: ALL

Typing a password when using SSH also annoys me. From your workstation, run the command:

ssh-copy-id <user>@<hostname>

If you like, you can disable passwords (in favor of security keys) by editing /etc/ssh/sshd_config.
Change PermitRootLogin and PasswordAuthentication.
Here's a quick command to do it:

sudo sed -i --follow-symlinks 's/#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
sudo sed -i --follow-symlinks 's/^PasswordAuthentication yes$/PasswordAuthentication no/g' /etc/ssh/sshd_config

YUM

Before using 'yum', always run an update:

sudo yum -y update

Oracle comes with some interesting repositories. Take a look at "/etc/yum.repos.d" for a list of repositories.
To enable them, type:

sudo yum -y install yum-utils
sudo yum-config-manager --enable <repository>

Open VM Tools

If needed, install Open VM Tools.

sudo yum -y install open-vm-tools

SELinux

It must have a purpose, but I find it annoying. It can be disabled like this:

sudo setenforce 0
sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux

Firewall

I also find the built-in firewall annoying. 

To disable it:

sudo systemctl stop firewalld
sudo systemctl disable firewalld

However, if you would like to use it properly, here are some examples to give you ideas:

sudo firewall-cmd --add-port=1521/tcp --permanent
sudo firewall-cmd --add-port=5060/udp --permanent
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https

sudo systemctl restart firewalld

Random Numbers

Headless servers have a hard time producing random numbers. This will slow WebLogic and other applications.
To check your entropy:

cat /proc/sys/kernel/random/entropy_avail

If the number is less than 1000, install 'haveged':

sudo yum-config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/x86_64
sudo yum -y install haveged
sudo systemctl enable haveged.service
sudo systemctl start haveged

Kernel Parameter Tuning

Here's a quick way to tune kernel parameters:

yum -y install oracle-database-preinstall-19c

Wireshark

Getting this error?

libGL error: failed to load driver: swrast

Install drivers:

sudo dnf install -y mesa-dri-drivers

Getting this error?

libGL error: No matching fbConfigs or visuals found

Create an environment variable, like so: