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

How to manage ACLs on Linux

Objective

Introduction to the management of ACLs ( Access Control List ) on Linux

Operating System and Software Versions

  • Operating System: – Linux distribution agnostic

Requirements

  • Root access on a working Linux installation
  • Knowledge of Discretionary permission system
  • A filesystem which supports ACLs (e.g xfs, ext2, ext3, ext4), mounted with the ‘acl’ option
  • Having the ‘acl’ package installed

Difficulty

MEDIUM

Conventions

Read more

How to verify Checksums in Linux

Objective

Verify the integrity of ISO downloads using GPG keys.

Distributions

This will work with any Linux distribution.

Requirements

* A working Linux install with root access.
* GPG

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

Read more

Introduction To Linux File Permissions

Linux Permissions, How Do They Work?

The Linux permission system for files can appear somewhat confusing to new Linux users. There’s a system of letters or numbers all jumbled together in a seemingly unordered mess.

In reality, it’s quite simple, once you understand how it’s broken down.

Directories, Links, Read, Write, and Execute

Start off by going to a folder in your home directory. The Downloads folder is usually a good option. Once you’re there, run ls -lah.

$ cd ~/Downloads
$ ls -lah

Read more

How to Manipulate HTTP With cURL

Objective

Learn how to use cURL to make HTTP requests to interact with online content.

Distributions

All GNU/Linux distributions

Requirements

Just cURL. It’s available in every distribution’s repository.

Difficulty

Easy

Conventions

# – requires root access either via su or sudo.

$ – run as your regular user

Introduction

cURL is a command line multi-tool for interacting with the web. cURL is capable of acting like a web browser, downloading files, accessing APIs, and even signing you into online accounts. cURL can be scripted, and it handles everything from a simple command line interface.

Read more

Detecting which system manager is running on Linux System

Objective

There are multiple system managers which can by possibly running on your Linux system. The current most common system managers are SysV (init), Systemd and Upstart. You may find this short guide to be of use to you, if you are unsure which, system manager is running on your Linux system.

Requirements

Privileged access to your Linux system is required.

Difficulty

EASY

Conventions

Read more

Enigmail Setup Wizard

Encrypt Your Email With GPG, Thunderbird, and Enigmail

Introduction

Encrypting everything online is becoming more important by the day. Email is no different. For Linux users, the process is actually very simple with three common open source tools; Mozilla Thunderbird, Enigmail, and GNU PGP(GPG.) Through the use of these three tools, you can send and receive encrypted messages easily, and protect yourself and the people you’re communicating with from attackers and privacy invasions.

Gathering The Pieces

Install GPG

The first thing that you will need in order to begin encrypting your emails is GPG. Since GPG is part of the GNU Project and is a common tool for generating encryption keys, it’s likely to be in any distro’s repositories. Use your package manager to install it.

Read more

Manage Vim Plugins With Pathogen

Introduction

There’s no denying that Vim is awesome on its own. It provides users with unprecedented configuration potential and quick, powerful commands. That said, Vim can get even better with the use of plugins.

There are hundreds of plugins that can seriously amp-up your Vim installation. Many of them are tailored for specific uses, like programming in a certain language or even writing. Others are more general and enhance Vim’s existing capabilities. Whichever it is that you need, you’re going to have to manage those packages.

There are a number of Vim package managers, but Pathogen is the most universal and simple to use and install. Pathogen works by pulling all of the Vim plugins in a certain directory into your Vim installation and activating them with a single line in your .vimrc file.

Read more

How to Securely Transfer Files With SFTP

Introduction

Transferring files between computers can be a pain. FTP is somewhat clunky and old, and using online services isn’t direct and is less than ideal for handling sensitive files. Git works well for code and text, but isn’t the best for binary files and requires a repository to be configured. So, what’s a good solution for sending files directly between computers? SFTP.

SFTP is a secure file transfer protocol that makes use of SSH to send files between computers. It is encrypted and direct. It allows you to use an existing service to send files, thereby reducing your attack surface, and it eliminates the need to rely on potentially vulnerable passwords for file transfers.

Before you go any further, you need to set up SSH keys for the machines you want to work with. If you don’t know how, check out our guide on setting up SSH key based authentication.

Read more

How to perform a faster data compression with pbzip2

Introduction

What if you would be able to perform a data compression four times faster, with the same compression ratio as you normally do. Pbzip2 command line utility can easily accomplish this as it gives you an option to select number CPU and amount of RAM to be used during the compression process.

Regular tar and bzip2 compression

We all know the regular command to perform tar and bzip2 directory compression. The below command will tar and compress our sandbox directory FOOBAR. We are also prefixing the below command to get exact time for how long will it take to output compressed file FOOBAR.tar.Bbz2 from 242MB FOOBAR directory:

# time tar cjf FOOBAR1.tar.bz2 FOOBAR/

real    0m20.030s
user    0m19.828s
sys     0m0.304s

From the above time output we can see that it took about 20 seconds to create following compressed file:

# ls -lh FOOBAR1.tar.bz2 
-rw-r--r-- 1 root root 54M Mar 10 20:25 FOOBAR1.tar.bz2

Read more