Cryptsetup Create Linux Encrypted Volumes

What's Cryptsetup? According to Cryptsetup's Gitlab project page; Cryptsetup is utility used to conveniently setup disk encryption based on DMCrypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt (including VeraCrypt extension) format. Project also includes veritysetup utility used to conveniently setup DMVerity block integrity checking kernel module. To install LUKS: Activate Dmcrypt: Create the file to encrypt: Technically we are converting and coping a file. if: input file, we are using /dev/zero to fill the file with null characters (ASCII NUL, 0x00).

Journalctl examples

Journald address one major issue with Linux applications logging, it provides a centralized management logging for the Kernel and the userland processes regardless where the logs are coming from. you can also use journald as an alternative looging driver inside Docker containers, this feature is available since Docker version 1.7. To view logs written by journald you may use journalctl, it will show the full content of the journal when it's called without parameters:

Clear content of multiple files at once

When I am updating my Linux template, I like to delete all old logs, as a first step, I delete old rotated logs. First check how your logs are rotated and create a find command the one below to delete old rotated logs: The command above will delete all file that match the rule, you can limit how deep you want to find files using maxdepth. you can also use mtime +n to find files older than n days and delete them.

How to clear content of multiple files at once

When I am updating my Linux template, I like to delete all old logs, as a first step, I delete old rotated logs. First check how your logs are rotated and create a find command the one below to delete old rotated logs: The command above will delete all file that match the rule, you can limit how deep you want to find files using maxdepth. you can also use mtime +n to find files older than n days and delete them.

OSSEC - log rotation

When SELinux enabled, some OSSEC packages will fail to rotate logs under /var/ossec/logs, which will result in crontab errors and in some cases failure to write to logs. One way to fix this is to change context type, for this let's first check the current context: Command explanation: semanage fcontext : Used to change SELinux context of files. semanage fcontext -a: Add object to record name. semanage fcontext -t: SELinux type of Object.