Categories
Sysadmin

Hardening desktop Linux

At every new installation of Linux (Kubuntu) i will set some performance and stable optimizations.


Use ramdisk to mount the /tmp folder

If you have a SSD is important to limit the write operations for a better disk life. So let’s use mount the tmp folder in RAM.

# nano /etc/fstab
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[...]
/swapfile                                 none            swap    sw              0       0
tmpfs   /tmp    tmpfs   defaults,noatime,nosuid,mode=1777,size=8G  0       0

Append the bold line and adjust the size as half of your RAM. So if you have 16GB of RAM then limit the tmp folder up to 8GB.


Disable splash screen at boot

The correct way to disable the splash screen, even will future Grub updated, is to edit the default configuration.

# nano /etc/default/grub
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[...]
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
[...] 

Delete the “quiet splash” from the Grub command line and save the file.

[...]
GRUB_CMDLINE_LINUX_DEFAULT=""
[...]

Regenerate the grub.cfg with the command update-grub2.

# update-grub2

Disable the login KDE splash screen

In Kunbuntu 18.04 the theme breeze has a annoying bug.

Run the following command (press ALT+F2) to open the splashscreen configuration

/usr/bin/kcmshell5 kcm_splashscreen

Select “none” and after “apply”.


Disable Baloo file indexing

If you have and SSD is also raccomended to  disable Baloo file indexing to increase the performance.

# balooctl disable
# killall baloo_file