How to use special permissions: the setuid, setgid and sticky bits

Objective

Getting to know how special permissions works, how to identify and set them.

Requirements

  • Knowledge of the standard unix/linux permissions system

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

Normally, on a unix-like operating system, the ownership of files and directories is based on the default uid (user-id) and gid (group-id) of the user who created them. The same thing happens when a process is launched: it runs with the effective user-id and group-id of the user who started it, and with the corresponding privileges. This behavior can be modified by using special permissions.

Read more

bash scripting

How to modify scripts behavior on signals using bash traps

Objective

The objective of this tutorial is to describe how to use the bash shell trap builtin to make our scripts able to perform certain actions when they receive a signal or in other specific situations.

Requirements

  • No special requirements

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

bash scriptingWhen writing scripts that are meant to run for a considerable time, it’s very important to increase their robustness by making them able to react to system signals, executing specific actions when some of them are received. We can accomplish this task by using the bash trap builtin.

Read more

How to use GNU Stow to manage programs installed from source and dotfiles

Objective

Easily manage programs installed from source and dotfiles using GNU stow

Requirements

  • Root permissions

Difficulty

EASY

Conventions

  • # – requires given linux commands to be executed with root privileges either
    directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Introduction

Sometimes we have to install programs from source: maybe they are not available through standard channels, or maybe we want a specific version of a software. GNU stow is a very nice symlinks factory program which helps us a lot by keeping files organized in a very clean and easy to maintain way.

Read more

guest_installer

How to create and manage KVM virtual machines from CLI

Objective

Learn how to create and manage KVM virtual machines from command line

Operating System and Software Versions

  • Operating System: – All Linux distributions

Requirements

  • Root access
  • Packages:
    • qemu-kvm – The main package
    • libvirt – Includes the libvirtd server exporting the virtualization support
    • libvirt-client – This package contains virsh and other client-side utilities
    • virt-install – Utility to install virtual machines
    • virt-viewer – Utility to display graphical console for a virtual machine

Difficulty

MEDIUM

Conventions

Read more

Introduction to SELinux concepts and management

Objective

Introduction to SELinux concepts and management

Operating System and Software Versions

  • Operating System: – Linux distribution agnostic

Requirements

  • Root access on a working Linux installation with a valid SElinux policy
  • policycoreutils package: it provides getsebool, setsebool, restorecon utilities
  • coreutils package: provides chcon utility
  • policycoreutils-python package: provides semanage command
  • policycoreutils-newrole: provides the newrole program
  • setools-console: provides seinfo command

Difficulty

MEDIUM

Conventions

Read more