<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CentOS on nagg.eu</title><link>https://nagg.eu/tags/centos/</link><description>Recent content in CentOS on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 20 Oct 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/centos/index.xml" rel="self" type="application/rss+xml"/><item><title>Remotely unlock a full disk encrypted Fedora 40 server</title><link>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-40-server/</link><pubDate>Sun, 20 Oct 2024 00:00:00 +0000</pubDate><guid>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-40-server/</guid><description>&lt;p&gt;What I have been doing in &lt;a href="https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-33-server/"&gt;2020&lt;/a&gt;
and &lt;a href="https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-centos-server/"&gt;before&lt;/a&gt;
doesn&amp;rsquo;t seem to work anymore, ence it is time to publish a new episode of the
saga: how to remotely unlock a full disk encrypted Linux machine.&lt;br&gt;
&lt;a href="https://github.com/gsauthof/dracut-sshd"&gt;dracut-sshd&lt;/a&gt; still works perfectly
even though the surroundings changed a bit.&lt;/p&gt;
&lt;p&gt;First step is instructing dracut to add &lt;code&gt;dracut-sshd&lt;/code&gt; into initramfs:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ sudo dnf install dracut dracut-network openssh
$ git clone https://github.com/gsauthof/dracut-sshd.git
$ cd dracut-sshd
$ sudo cp -ri 46sshd /usr/lib/dracut/modules.d
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Configure grub to instruct dracut to add networking to initramfs:&lt;/p&gt;</description></item><item><title>Remotely unlock a full disk encrypted Fedora 33 server</title><link>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-33-server/</link><pubDate>Tue, 08 Dec 2020 00:00:00 +0000</pubDate><guid>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-33-server/</guid><description>&lt;p&gt;Last year I blogged on how to &lt;a href="https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-centos-server/"&gt;remotely unlock a full disk encrypted Fedora/CentOS server&lt;/a&gt;.&lt;br&gt;
The software I used, &lt;a href="https://github.com/dracut-crypt-ssh/dracut-crypt-ssh"&gt;dracut-crypt-ssh&lt;/a&gt;,
is not supported anymore and stopped working for me on Fedora 32 and 33.&lt;br&gt;
A quick DDG search pointed me in the right direction and made me find a similar
software that accomplishes the same task: &lt;a href="https://github.com/gsauthof/dracut-sshd"&gt;dracut-sshd&lt;/a&gt;.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ sudo dnf install dracut dracut-network openssh libblkid-devel gcc
$ git clone https://github.com/gsauthof/dracut-sshd.git
$ cd dracut-sshd
$ sudo cp -ri 46sshd /usr/lib/dracut/modules.d
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After compiling and installing &lt;code&gt;dracut-crypt-ssh&lt;/code&gt; configure grub to instruct
dracut to add networking to initramfs:&lt;/p&gt;</description></item><item><title>XMPP audio and video calls</title><link>https://nagg.eu/xmpp-audio-and-video-calls/</link><pubDate>Sun, 03 May 2020 00:00:00 +0000</pubDate><guid>https://nagg.eu/xmpp-audio-and-video-calls/</guid><description>&lt;p&gt;Ejabberd has supported STUN/TURN for quite some time now, this in conjunction
with client support can be used to implement one on one audio and video calls.&lt;br&gt;
Since version 2.8.0 &lt;a href="https://github.com/iNPUTmice/Conversations"&gt;Conversations Android client&lt;/a&gt;
added audio and video call functionality by leveraging on STUN/TURN and &lt;a href="https://xmpp.org/extensions/xep-0215.html"&gt;XEP-0215&lt;/a&gt;.&lt;br&gt;
The rest of the XMPP world is following the route opened by them, so I expect
to see IOS and regular computer XMPP clients to finally implement these new
features too in the upcoming months.&lt;br&gt;
Enabling audio and video calls in Ejabberd is actually pretty simple.&lt;br&gt;
Provided you have installed the latest release (version &lt;code&gt;20.04&lt;/code&gt;), edit
&lt;code&gt;ejabberd.yml&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Disable head parking Western Digital drives</title><link>https://nagg.eu/disable-head-parking-western-digital-drives/</link><pubDate>Sun, 04 Aug 2019 00:00:00 +0000</pubDate><guid>https://nagg.eu/disable-head-parking-western-digital-drives/</guid><description>&lt;p&gt;Most Western Digital hard drives&amp;rsquo; firmware let the heads park themselves after
a certain amount of seconds in case the disk is not actively performing any
operation.&lt;br&gt;
This might be useful to keep power consumption under control but is actually
harmful for disks that run 24/7 (WD Red for example).&lt;br&gt;
Luckily there is a way to disable head parking, this can be done directly from
Linux using a tool called &lt;code&gt;idle3ctl&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Remotely unlock a full disk encrypted Fedora/CentOS server</title><link>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-centos-server/</link><pubDate>Sat, 26 Jan 2019 00:00:00 +0000</pubDate><guid>https://nagg.eu/remotely-unclock-a-full-disk-encrypted-fedora-centos-server/</guid><description>&lt;p&gt;The idea here is to be able to power on and unlock a remote Full Disk Encrypted
(FDE from now on) server.&lt;br&gt;
I will leave the how &amp;ldquo;remotely power on&amp;rdquo; to the reader to figure out and focus
on the other part.&lt;br&gt;
The easiest way to accomplish it is by using a program called:
&lt;code&gt;dracut-crypt-ssh&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
$ yum install dropbear dracut dracut-network openssh libblkid-devel gcc
$ git clone https://github.com/dracut-crypt-ssh/dracut-crypt-ssh.git
$ cd dracut-crypt-ssh
$ ./configure
$ make
$ sudo make install
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After compiling and installing &lt;code&gt;dracut-crypt-ssh&lt;/code&gt; configure grub to instruct
dracut to add networking to initramfs:&lt;/p&gt;</description></item><item><title>Resize QCOW2 disk image</title><link>https://nagg.eu/resize-qcow2-disk-image/</link><pubDate>Wed, 05 Dec 2018 00:00:00 +0000</pubDate><guid>https://nagg.eu/resize-qcow2-disk-image/</guid><description>&lt;p&gt;QCOW2 disk images can be easily grown using libvirt command line utils.&lt;br&gt;
Unfortunately it isn&amp;rsquo;t possible to grow QCOW2 images in-place or online.&lt;br&gt;
First of all, power off the virtual machine, grow the file and make a copy of
it:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
$ qemu-img resize image.qcow2 +200G
$ cp image.qcow2 image-new.qcow2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Identify the specific partion you intend to grow:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
$ virt-filesystems -a image.qcow2 -l
Name Type VFS Label Size Parent
/dev/sda1 filesystem ext4 - 536870912 -
/dev/sda3 filesystem xfs - 45885612000 -
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Expand the actual partition:&lt;/p&gt;</description></item><item><title>Nginx and XMPP over TLS</title><link>https://nagg.eu/nginx-and-xmpp-over-tls/</link><pubDate>Sun, 28 Oct 2018 00:00:00 +0000</pubDate><guid>https://nagg.eu/nginx-and-xmpp-over-tls/</guid><description>&lt;p&gt;XMPP over TLS (formerly XEP-0368) is a clever mechanism that allows users to
connect to a XMPP server from networks that restrict outgoing traffic only to
specific ports; this block is circumvent by routing XMPP traffic via port TCP
443.&lt;br&gt;
If the server hosts only a XMPP server setting up XMPP over TLS is pretty easy,
just instruct the server to listen on port 443.&lt;br&gt;
If the server also runs a webserver which is listening on port 443 things are a
bit more complicated; luckily Nginx provides a way to manage XMPP traffic and
redirect it to the XMPP server.&lt;/p&gt;</description></item><item><title>Remote encrypted backup with iSCSI and LUKS2</title><link>https://nagg.eu/remote-encrypted-backup-with-iscsi-and-luks2/</link><pubDate>Mon, 27 Aug 2018 19:19:08 +0000</pubDate><guid>https://nagg.eu/remote-encrypted-backup-with-iscsi-and-luks2/</guid><description>&lt;p&gt;The idea here is to have a LUKS2 encrypted volume stored on a remote server
that allows authenticated clients to load and decrypt the data without letting
the server know what is being written, read and stored.&lt;br&gt;
Keep in mind that this solution is not 100% bulletproof, you still kind of have
to trust the backup server because a malicious entity might take multiple
snapshots of the encrypted iSCSI LUN and try to crack the encryption.&lt;/p&gt;</description></item><item><title>Generate a secure SSH key</title><link>https://nagg.eu/generate-a-secure-ssh-key/</link><pubDate>Fri, 10 Aug 2018 14:42:19 +0000</pubDate><guid>https://nagg.eu/generate-a-secure-ssh-key/</guid><description>&lt;p&gt;In Fedora, CentOS and probably many other Linux distros &lt;code&gt;ssh-keygen&lt;/code&gt;; still defaults to RSA 2048.&lt;br&gt;
People have not yet realized that the newer, and also faster, elliptic curve cryptography is available; even between my peers I still see that many of them are using old and insecure RSA based keys. Since SSH clients support multiple keys transitioning to newer keys can be painless:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create a new elliptic curve key;&lt;/li&gt;
&lt;li&gt;do not delete the old RSA key;&lt;/li&gt;
&lt;li&gt;once you login into a server swap the old key with the new one.&lt;br&gt;
Generating a new secure SSH key is pretty simple, just open a terminal and run:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ssh-keygen -o -a 256 -t ed25519
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Configure apcupsd on CentOS</title><link>https://nagg.eu/configure-apcupsd-on-centos/</link><pubDate>Mon, 25 Jun 2018 18:04:19 +0000</pubDate><guid>https://nagg.eu/configure-apcupsd-on-centos/</guid><description>&lt;p&gt;Apcupsd is a powerful daemon that can be used to manage APC UPS, add epel repositories and run:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ yum install apcupsd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To configure apcupsd edit the following file:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cat /etc/apcupsd/apcupsd.conf&amp;#34;
---
## apcupsd.conf v1.1 ##
# 
# for apcupsd release 3.14.14 (31 May 2016) - redhat
#
# &amp;#34;apcupsd&amp;#34; POSIX config file

#
# Note that the apcupsd daemon must be restarted in order for changes to
# this configuration file to become active.
#

#
# ========= General configuration parameters ============
#

# UPSNAME xxx
# Use this to give your UPS a name in log files and such. This
# is particulary useful if you have multiple UPSes. This does not
# set the EEPROM. It should be 8 characters or less.
UPSNAME apcups

# UPSCABLE &amp;lt;cable&amp;gt;
# Defines the type of cable connecting the UPS to your computer.
#
# Possible generic choices for &amp;lt;cable&amp;gt; are:
# simple, smart, ether, usb
#
# Or a specific cable model number may be used:
# 940-0119A, 940-0127A, 940-0128A, 940-0020B,
# 940-0020C, 940-0023A, 940-0024B, 940-0024C,
# 940-1524C, 940-0024G, 940-0095A, 940-0095B,
# 940-0095C, 940-0625A, M-04-02-2000
#
UPSCABLE usb

# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character device, appropriate for 
# SmartUPS models using a serial cable (not USB).
#
# usb &amp;lt;BLANK&amp;gt; Most new UPSes are USB. A blank DEVICE
# setting enables autodetection, which is
# the best choice for most installations.
#
# net hostname:port Network link to a master apcupsd through apcupsd&amp;#39;s 
# Network Information Server. This is used if the
# UPS powering your computer is connected to a 
# different computer for monitoring.
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNMP-enabled UPS device.
# Hostname is the ip address or hostname of the UPS 
# on the network. Vendor can be can be &amp;#34;APC&amp;#34; or 
# &amp;#34;APC_NOTRAP&amp;#34;. &amp;#34;APC_NOTRAP&amp;#34; will disable SNMP trap 
# catching; you usually want &amp;#34;APC&amp;#34;. Port is usually 
# 161. Community is usually &amp;#34;private&amp;#34;.
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requires use of the 
# net-snmp library. Unless you have a specific need
# for this old driver, you should use &amp;#39;snmp&amp;#39; instead.
#
# dumb /dev/tty** Old serial character device for use with 
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown protocol which can be 
# used as an alternative to SNMP with the AP9617 
# family of smart slot cards. ipaddr is the IP 
# address of the UPS management card. username and 
# passphrase are the credentials for which the card 
# has been configured. port is the port number on 
# which to listen for messages from the UPS, normally 
# 3052. If this parameter is empty or missing, the 
# default of 3052 will be used.
#
# modbus /dev/tty** Serial device for use with newest SmartUPS models
# supporting the MODBUS protocol.
# modbus &amp;lt;BLANK&amp;gt; Leave the DEVICE setting blank for MODBUS over USB
# or set to the serial number of the UPS to ensure 
# that apcupsd binds to that particular unit
# (helpful if you have more than one USB UPS).
#
UPSTYPE usb
DEVICE 

# POLLTIME &amp;lt;int&amp;gt;
# Interval (in seconds) at which apcupsd polls the UPS for status. This
# setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, 
# dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting
# will improve apcupsd&amp;#39;s responsiveness to certain events at the cost of
# higher CPU utilization. The default of 60 is appropriate for most
# situations.
POLLTIME 60

# LOCKFILE &amp;lt;path to lockfile&amp;gt;
# Path for device lock file. This is the directory into which the lock file
# will be written. The directory must already exist; apcupsd will not create
# it. The actual name of the lock file is computed from DEVICE.
# Not used on Win32.
LOCKFILE /var/lock

# SCRIPTDIR &amp;lt;path to script directory&amp;gt;
# Directory in which apccontrol and event scripts are located.
SCRIPTDIR /etc/apcupsd

# PWRFAILDIR &amp;lt;path to powerfail directory&amp;gt;
# Directory in which to write the powerfail flag file. This file
# is created when apcupsd initiates a system shutdown and is
# checked in the OS halt scripts to determine if a killpower
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd

# NOLOGINDIR &amp;lt;path to nologin directory&amp;gt;
# Directory in which to write the nologin file. The existence
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc


#
# ======== Configuration parameters used during power failures ==========
#

# The ONBATTERYDELAY is the time in seconds from when a power failure
# is detected until we react to it with an onbattery event.
#
# This means that, apccontrol will be called with the powerout argument
# immediately when a power failure is detected. However, the
# onbattery argument is passed to apccontrol only after the 
# ONBATTERYDELAY time. If you don&amp;#39;t want to be annoyed by short
# powerfailures, make sure that apccontrol powerout does nothing
# i.e. comment out the wall.
ONBATTERYDELAY 6

# 
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
# the first that occurs will cause the initation of a shutdown.
#

# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL, 
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5

# If during a power failure, the remaining runtime in minutes 
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
MINUTES 10

# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely want to disable
# this timer by setting it to zero. That way, you UPS will continue
# on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
# or the remaining battery runtime drops to or below MINUTES. Of course,
# if you are testing, setting this to 60 causes a quick system shutdown
# if you pull the power plug. 
# If you have an older dumb UPS, you will want to set this to less than
# the time you know you can run on batteries.
TIMEOUT 60

# Time in seconds between annoying users to signoff prior to
# system shutdown. 0 disables.
#ANNOY 300
ANNOY 0

# Initial delay after power failure before warning users to get
# off the system.
#ANNOYDELAY 60
ANNOYDELAY 1

# The condition which determines when users are prevented from
# logging in during a power failure.
# NOLOGON &amp;lt;string&amp;gt; [ disable | timeout | percent | minutes | always ]
NOLOGON disable

# If KILLDELAY is non-zero, apcupsd will continue running after a
# shutdown has been requested, and after the specified time in
# seconds attempt to kill the power. This is for use on systems
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY &amp;lt;seconds&amp;gt; 0 disables
KILLDELAY 0

#
# ==== Configuration statements for Network Information Server ====
#

# NETSERVER [ on | off ] on enables, off disables the network
# information server. If netstatus is on, a network information
# server process will be started for serving the STATUS and
# EVENT data over the network (used by CGI programs).
NETSERVER on

# NISIP &amp;lt;dotted notation ip address&amp;gt;
# IP address on which NIS server will listen for incoming connections.
# This is useful if your server is multi-homed (has more than one
# network interface and IP address). Default value is 0.0.0.0 which
# means any incoming request will be serviced. Alternatively, you can
# configure this setting to any specific IP address of your server and 
# NIS will listen for connections only on that interface. Use the
# loopback address (127.0.0.1) to accept connections only from the
# local machine.
NISIP 127.0.0.1

# NISPORT &amp;lt;port&amp;gt; default is 3551 as registered with the IANA
# port to use for sending STATUS and EVENTS data over the network.
# It is not used unless NETSERVER is on. If you change this port,
# you will need to change the corresponding value in the cgi directory
# and rebuild the cgi programs.
NISPORT 3551

# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
EVENTSFILE /var/log/apcupsd.events

# EVENTSFILEMAX &amp;lt;kilobytes&amp;gt;
# By default, the size of the EVENTSFILE will be not be allowed to exceed
# 10 kilobytes. When the file grows beyond this limit, older EVENTS will
# be removed from the beginning of the file (first in first out). The
# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10

#
# ========== Configuration statements used if sharing =============
# a UPS with more than one machine

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an APC ShareUPS
# card.
UPSCLASS standalone

# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an APC ShareUPS card.
UPSMODE disable

#
# ===== Configuration statements to control apcupsd system logging ========
#

# Time interval in seconds between writing the STATUS file; 0 disables
STATTIME 0

# Location of STATUS file (written to only if STATTIME is non-zero)
STATFILE /var/log/apcupsd.status

# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if 
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a named pipe.
# You probably do not want this on.
LOGSTATS off

# Time interval in seconds between writing the DATA records to
# the log file. 0 disables.
DATATIME 0

# FACILITY defines the logging facility (class) for logging to syslog. 
# If not specified, it defaults to &amp;#34;daemon&amp;#34;. This is useful 
# if you want to separate the data logged by apcupsd from other
# programs.
#FACILITY DAEMON

#
# ========== Configuration statements used in updating the UPS EPROM =========
#

#
# These statements are used only by apctest when choosing &amp;#34;Set EEPROM with conf
# file values&amp;#34; from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
#

# UPS name, max 8 characters 
#UPSNAME UPS_IDEN

# Battery date - 8 characters
#BATTDATE mm/dd/yy

# Sensitivity to line voltage quality (H cause faster transfer to batteries) 
# SENSITIVITY H M L (default = H)
#SENSITIVITY H

# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60

# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
#SLEEP 180

# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
# of FIRMWARE or APCMODEL. Some representative values are:
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 =&amp;gt; not valid)
#LOTRANSFER 208

# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter 
# of FIRMWARE or APCMODEL. Some representative values are:
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 =&amp;gt; not valid)
#HITRANSFER 253

# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15

# Alarm delay 
# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T

# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2

# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined by last letter 
# of FIRMWARE or APCMODEL. Some representative values are:
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 =&amp;gt; not valid)
#OUTPUTVOLTS 230

# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
# SELFTEST 336 168 ON OFF (default = 336)
#SELFTEST 336
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The configuration I use is pretty simple, basically shutdown the server if the power is down for more than one minute.&lt;br&gt;
ANNOY flag is also disabled (set to 0) because I do not need it on headless servers.&lt;/p&gt;</description></item><item><title>APC UPS and HP server gen8 not restarting automatically when power goes back online after shutdown procedure is already starded but not completed</title><link>https://nagg.eu/apc-ups-and-hp-server-gen8-not-restarting-automatically-when-power-goes-back-online-after-shutdown-procedure-is-already-starded-but-not-completed/</link><pubDate>Mon, 25 Jun 2018 17:35:54 +0000</pubDate><guid>https://nagg.eu/apc-ups-and-hp-server-gen8-not-restarting-automatically-when-power-goes-back-online-after-shutdown-procedure-is-already-starded-but-not-completed/</guid><description>&lt;p&gt;I have got my hands on an APC UPS and some HP gen8 server, installed apcupsd on CentOS 7, connected the USB cable and everything was working fine except for this very annoying issue I had: * power goes down (pull the UPS power cord).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;after some minutes the UPS battery threshold is triggered and the server shutdown procedure is launched by apcupsd.&lt;/li&gt;
&lt;li&gt;power goes back up (plug in the power cord) while the server is already shutting down but the shutdown sequence is not yet completed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;RESULT&lt;/strong&gt;: the server will not power itself up even if the correct setting is selected in BIOS (&lt;code&gt;last power state&lt;/code&gt; or &lt;code&gt;always on&lt;/code&gt;).&lt;br&gt;
If the power stays offline for enough time for the server to completely shutdown and for the UPS to also shutdown once the power goes back online the server starts up automatically like it is supposed to do.&lt;br&gt;
The only workaround I could think of to solve the issue is running a cron job on the router, which is running OpenWRT, to trigger wake-on-LAN for the server.&lt;br&gt;
I don&amp;rsquo;t really like this solution, it feels hackish but still I could not find a better way to make the damn server power on automatically all by himself.&lt;br&gt;
As for OpenWRT and wake-on-LAN, first of all install &lt;code&gt;etherwake&lt;/code&gt; from LuCI or opkg:&lt;/p&gt;</description></item><item><title>OpenVPN: tun tap invalid argument (code=22)</title><link>https://nagg.eu/openvpn-tun-tap-invalid-argument-code22/</link><pubDate>Fri, 11 May 2018 12:29:10 +0000</pubDate><guid>https://nagg.eu/openvpn-tun-tap-invalid-argument-code22/</guid><description>&lt;p&gt;After upgrading my OpenVPN server to CentOS 7.5 I had trouble connecting to it.&lt;br&gt;
Specifically, I had two different issues:&lt;br&gt;
** the laptop, which is running Fedora 28, was able to connect just fine but
DNS resolution was broken.&lt;br&gt;
** OpenVPN for Android was also connecting just fine but reporting a weird
error: &lt;code&gt;OpenVPN: tun tap invalid argument (code=22)&lt;/code&gt;.&lt;br&gt;
The first one was caused by me because after the CentOS upgrade procedure was
completed I also run &lt;code&gt;yum autoremove&lt;/code&gt; which deleted dnsmasq; the solution was
fairly simple, reinstall and reconfigure &lt;a href="https://nagg.eu/openvpn-server-and-centos/"&gt;dnsmasq&lt;/a&gt;.&lt;br&gt;
For the second issue the solution was to enable comp-lzo and voilà, everything
started working again.&lt;/p&gt;</description></item><item><title>Self hosting Firefox Sync on CentOS 7</title><link>https://nagg.eu/self-hosting-firefox-sync-on-centos-7/</link><pubDate>Wed, 18 Oct 2017 17:22:49 +0000</pubDate><guid>https://nagg.eu/self-hosting-firefox-sync-on-centos-7/</guid><description>&lt;p&gt;Configuring this piece of poorly documented bloated shit Mozilla came up with was a huge pain in the ass, so excuse the colored language but I am fucking pissed.&lt;br&gt;
The idea was to finally implement a system to synchronize Firefox&amp;rsquo;s bookmarks across multiple devices without giving Mozilla all my personal data.&lt;br&gt;
After some minutes spent researching the subject on the interweb I found out the synchronization system is a huge clusterfuck comprised of multiple components:&lt;/p&gt;</description></item><item><title>CentOS and yum - Error: rpmdb open failed</title><link>https://nagg.eu/centos-and-yum-error-rpmdb-open-failed/</link><pubDate>Tue, 29 Aug 2017 12:23:37 +0000</pubDate><guid>https://nagg.eu/centos-and-yum-error-rpmdb-open-failed/</guid><description>&lt;p&gt;Today I had Ansible reporting an error on one of my CentOS machines while performing the usual upgrade procedure.&lt;br&gt;
I SSH&amp;rsquo;d into the host to check what was wrong and run &lt;code&gt;yum clean all &amp;amp;&amp;amp; yum update&lt;/code&gt; manually just to be greeted with the following error:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30974) from dbenv-&amp;gt;open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The solution to the issue luckily was fairly simple and quick:&lt;/p&gt;</description></item><item><title>NFS on Fedora</title><link>https://nagg.eu/nfs-on-fedora/</link><pubDate>Thu, 20 Jul 2017 20:33:48 +0000</pubDate><guid>https://nagg.eu/nfs-on-fedora/</guid><description>&lt;p&gt;NFS allows to share files and folders over network and is much much faster than
samba while using way less resources.&lt;br&gt;
To setup a NFS server on Fedora 26 install:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ dnf install nfs-utils
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Shared directories are listed in the following configuration file:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-vi" data-lang="vi"&gt;---
# Syntax
# &amp;lt;path&amp;gt; &amp;lt;ipaddr&amp;gt;(&amp;lt;option&amp;gt;)
/home/user/Public 192.168.0.0/255.255.255.0(ro,sync)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;More information can be found here: &lt;a href="https://fedoraproject.org/wiki/Administration_Guide_Draft/NFS"&gt;Fedora NFS administration guide&lt;/a&gt;.&lt;br&gt;
In the above example, the the directory &amp;lsquo;/home/user/Public&amp;rsquo; can be accessed by
every client in the same LAN with read-only permissions.&lt;br&gt;
In case SELinux is active and enforcing rules some further configuration might
be required:&lt;/p&gt;</description></item><item><title>Monitor hard disk health status with smartd on Linux</title><link>https://nagg.eu/monitor-hard-disk-health-status-with-smartd-on-linux/</link><pubDate>Thu, 02 Feb 2017 10:20:34 +0000</pubDate><guid>https://nagg.eu/monitor-hard-disk-health-status-with-smartd-on-linux/</guid><description>&lt;h2 id="this-does-not-really-works-read-this"&gt;This does not really works, read this: &lt;!-- raw HTML omitted --&gt;&lt;a href="https://nagg.eu/monitor-hard-disk-smart-status-in-python/"&gt;https://nagg.eu/monitor-hard-disk-smart-status-in-python/&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;&lt;/h2&gt;
&lt;p&gt;First of all install smartmontools, it has the same name on pretty much every distro:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ emerge -a1 smartmontools
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Proceed to edit its configuration file, at the bottom of the file there is a quick explaination of all the available parameters:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cat/etc/smartd.conf
---
DEVICESCAN -H -R 1 -R 5 -R 7 -R 10 -R 11 -R 196 -R 197 -R 199 -R 200 -m user@domain.tld -n standby,10,q
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Parameter &lt;code&gt;-H&lt;/code&gt; tells smartd to check the result of &lt;code&gt;overall-health self-assesment test&lt;/code&gt; which is pretty much useless, &lt;code&gt;-R&lt;/code&gt; is used to specify a single SMART attribute, if its value changes a mail is sent to &lt;a href="mailto:user@domain.tld"&gt;user@domain.tld&lt;/a&gt;.&lt;br&gt;
To send emails a MTA must be installed, in centos that is sendmail, in gentoo it is not strictly necessary to have a full fledget MTA installed, nullmailer will suffice.&lt;br&gt;
If it is not already installed:&lt;/p&gt;</description></item><item><title>mdadm RAID on Linux</title><link>https://nagg.eu/mdadm-raid-on-linux/</link><pubDate>Thu, 21 Jan 2016 21:06:19 +0000</pubDate><guid>https://nagg.eu/mdadm-raid-on-linux/</guid><description>&lt;p&gt;Every time I have to setup a software RAID in Linux using mdadm I forget something, this time I am writing it down once and for all (or at least I hope so).&lt;br&gt;
For the sake of simplicity I will use the creation of a RAID1 as example but this very same procedure can be applied for any other kind of RAID.&lt;/p&gt;
&lt;h2 id="raid-array-creation"&gt;RAID array creation&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. Partition the drives&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This step must be repeated for each drive of the array (/dev/sdb and /dev/sdc in my case).&lt;/p&gt;</description></item><item><title>Defragment XFS file system</title><link>https://nagg.eu/defragment-xfs-file-system/</link><pubDate>Wed, 20 Jan 2016 18:18:18 +0000</pubDate><guid>https://nagg.eu/defragment-xfs-file-system/</guid><description>&lt;p&gt;XFS just like EXT4 (&lt;!-- raw HTML omitted --&gt;I wrote a post about it last year&lt;!-- raw HTML omitted --&gt;) supports online defragmentation, to manage those volumes on CentOS and Fedora &lt;code&gt;xfsprogs&lt;/code&gt; package is needed.&lt;br&gt;
Fragmentation level of XFS volumes can be checked with the command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]$ xfs_db -c frag -r /dev/sdb1
actual 4491, ideal 4006, fragmentation factor 10.80%
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To perform online defragmentation of XFS volumes run the following command:&lt;/p&gt;</description></item><item><title>CentOS, DNSCrypt and pdnsd</title><link>https://nagg.eu/centos-dnscrypt-and-pdnsd/</link><pubDate>Sun, 01 Nov 2015 22:40:27 +0000</pubDate><guid>https://nagg.eu/centos-dnscrypt-and-pdnsd/</guid><description>&lt;p&gt;DNSCrypt installation process is pretty simple since it is present in the repository, pdnsd on the other hand is missing, luckily compiling from source is not that hard.&lt;br&gt;
For the sake of completeness I will also cover the procedure to install DNSCrypt from source, alternatively &lt;code&gt;yum install dnscrypt-proxy&lt;/code&gt;.&lt;br&gt;
Install the required dependencies and get the source code:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]# yum install gcc libsodium-devel libtool-ltdl-dev git wget
[root@CentOS ~]# git clone https://github.com/jedisct1/dnscrypt-proxy.git
[root@CentOS ~]# wget http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-1.2.9a-par.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="pdnsd"&gt;pdnsd&lt;/h2&gt;
&lt;p&gt;Compile and install:&lt;/p&gt;</description></item><item><title>ejabberd and fail2ban</title><link>https://nagg.eu/ejabberd-and-fail2ban/</link><pubDate>Wed, 16 Sep 2015 18:54:42 +0000</pubDate><guid>https://nagg.eu/ejabberd-and-fail2ban/</guid><description>&lt;p&gt;Fail2ban is a useful tool capable of mitigating brute force attacks performed
against a multitude of services (ejabberd in our case).&lt;br&gt;
Configuration is split between a multitude of files: &lt;code&gt;jail.conf&lt;/code&gt; defines which
filters are active while the filters scripts are placed in &lt;code&gt;./filter.d&lt;/code&gt; directory.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]# vi /etc/fail2ban/jail.conf
---
bantime = 1200
findtime = 1200
maxretry = 10

backend = auto

[ejabberd-auth]
enabled = true
port = 5222,5280,7777
action = iptables-multiport[name=ejabberd, port=&amp;#34;5222,5269,5280,777&amp;#34;, protocol=tcp]
logpath = /var/log/ejabberd/ejabberd.log
---
&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex="0"&gt;&lt;code&gt;[root@CentOS ~]# vi /etc/fail2ban/filter.d/ejabberd-auth.conf
---
[Definition]

failregex = ^=INFO REPORT====  ===\nI\(&amp;lt;0\.\d+\.0&amp;gt;:ejabberd_c2s:\d+\) : \([^)]+\) Failed authentication for .+ from IP &amp;lt;HOST&amp;gt; \({{(?:\d+,){3}\d+},\d+}\)$
                ^(?:\.\d+)? \[info\] &amp;lt;0\.\d+\.\d&amp;gt;@ejabberd_c2s:wait_for_feature_request:\d+ \([^\)]+\) Failed authentication for \S+ from IP &amp;lt;HOST&amp;gt;$
                ^.* Failed authentication for \S+ from &amp;lt;HOST&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;inexistent-account&amp;#34;&amp;gt;&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;bad-password&amp;#34;&amp;gt;&amp;gt;$
                ^.* from &amp;lt;&amp;lt;&amp;#34;&amp;lt;HOST&amp;gt;&amp;#34;&amp;gt;&amp;gt; failed with error: &amp;lt;&amp;lt;&amp;#34;badformed-jid&amp;#34;&amp;gt;&amp;gt;$

ignoreregex =

[Init]

journalmatch =
---
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The first two regular expressions are for user authentication while the others
are for administration panel login.&lt;br&gt;
Other useful commands are:&lt;/p&gt;</description></item><item><title>Defragment EXT4 file system</title><link>https://nagg.eu/defragment-ext4-file-system/</link><pubDate>Fri, 10 Apr 2015 16:55:03 +0000</pubDate><guid>https://nagg.eu/defragment-ext4-file-system/</guid><description>&lt;p&gt;EXT4 is usually pretty good at keeping files fragmentation at minimum, but, sometimes, especially if dealing with really huge files, some fragmentation may actually occur.&lt;br&gt;
Luckily EXT4 supports online defragmentation, command fsck displays, among other things, fragmentation percentage:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@fedora ~]$ fsck.ext4 -fvn /dev/sda1
e2fsck 1.42.12 (29-Aug-2014)
Warning! /dev/sda1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

 429 inodes used (1.31%, out of 32768)
 **5 non-contiguous files (1.2%)**
 1 non-contiguous directory (0.2%)
 # of inodes with ind/dind/tind blocks: 0/0/0
 Extent depth histogram: 420
 45161 blocks used (34.46%, out of 131072)
 0 bad blocks
 1 large file

 402 regular files
 17 directories
 0 character device files
 0 block device files
 0 fifos
 0 links
 1 symbolic link (1 fast symbolic link)
 0 sockets
------------
 420 files
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The command e4defrag, which is contained in e2fsprogs, can be used to perform online defragmentation of EXT4 volumes.&lt;/p&gt;</description></item><item><title>Email server: Dovecot and Postfix</title><link>https://nagg.eu/email-server-dovecot-and-postfix/</link><pubDate>Fri, 20 Feb 2015 14:23:20 +0000</pubDate><guid>https://nagg.eu/email-server-dovecot-and-postfix/</guid><description>&lt;h2 id="postfix-configuration"&gt;Postfix configuration&lt;/h2&gt;
&lt;p&gt;Install the required software:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ yum install postfix postgrey dovecot fail2ban spamassassin 
spamass-milter-postfix opendkim
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create TLS certificate, key and CA authority (replace &lt;code&gt;mail.domain.tld&lt;/code&gt; with a valid domain name):&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ mkdir /etc/postfix/ssl
$ cd /etc/postfix/ssl
$ openssl genrsa -aes256 -out mail.domain.tld.key 4096
$ chmod 600 mail.domain.tld.key
$ openssl req -sha256 -new -key mail.domain.tld.key -out mail.domain.tld.csr
$ openssl x509 -sha256 -req -days 1825 -in mail.domain.tld.csr -signkey mail.domain.tld.key -out mail.domain.tld.crt
$ openssl rsa -in mail.domain.tld.key -out mail.domain.tld.key.nopass
$ mv mail.domain.tld.key.nopass mail.domain.tld.key
$ openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 -sha256
$ chmod 600 mail.domain.tld.key
$ chmod 600 cakey.pem
$ openssl dhparam -out dhparams.pem 4096
$ chmod 600 dhparams.pem
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Edit &lt;code&gt;main.cf&lt;/code&gt; file accordingly (the other lines should be ok by default).&lt;br&gt;
No SQL database is used, for user authentication postfix relies on Linux users,
email data are stored in &lt;code&gt;~/Maildir&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>ejabberd XMPP server configuration guide</title><link>https://nagg.eu/ejabberd-xmpp-server-configuration-guide/</link><pubDate>Mon, 11 Aug 2014 16:08:21 +0000</pubDate><guid>https://nagg.eu/ejabberd-xmpp-server-configuration-guide/</guid><description>&lt;p&gt;I will be keeping this post up to date to keep track on how to configure and
mantain an ejabberd server working efficiently and secure. I strongly advise
any reader to read carefully what is written here and not just copy-and-paste
the configuration file.&lt;br&gt;
My blog also contains a bunch of other posts regarding ejabberd that are worth
giving a look at, use the search form.&lt;/p&gt;
&lt;h3 id="server"&gt;Server&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
CentOS 7.5.1804 x86_64
Erlang/OTP 21.1.1-1 x86_64
ejabberd 18.09
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="client"&gt;Client&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
LineageOS 15.1 (Android Nougat)
Conversations 2.3.5+fcr
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="-installation-and-initial-configuration"&gt;.:. Installation and initial configuration&lt;/h3&gt;
&lt;p&gt;Download and install erlang (release numbers here may not be up to date):&lt;/p&gt;</description></item><item><title>Nginx and password protected pages</title><link>https://nagg.eu/nginx-and-password-protected-pages/</link><pubDate>Wed, 05 Mar 2014 11:26:24 +0000</pubDate><guid>https://nagg.eu/nginx-and-password-protected-pages/</guid><description>&lt;p&gt;To password protect a directory &lt;code&gt;xyz&lt;/code&gt; and every file and subdirectory in it open the configuration file (nginx.conf or one of the virtual host configuration files) and add the following two lines:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;location /xyz/ {
 auth_basic &amp;#34;Restricted Area&amp;#34;;
 auth_basic_user_file conf.d/htpasswd;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;htpasswd file must be encrypted, it can be created using a tool named htpasswd.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@xenserver ~]# cd /etc/nginx/conf.d/
[root@xenserver ~]# htpasswd -b htpasswd user password
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>CentOS 6.4, QEMU+KVM</title><link>https://nagg.eu/centos-6-4-qemukvm/</link><pubDate>Mon, 19 Aug 2013 22:54:50 +0000</pubDate><guid>https://nagg.eu/centos-6-4-qemukvm/</guid><description>&lt;p&gt;It&amp;rsquo;s summer, it&amp;rsquo;s hot as hell, I am back home from mountains and I&amp;rsquo;ve &lt;em&gt;plenty&lt;/em&gt; of free time.&lt;br&gt;
Between a barbecue and the next one I spend my time playing with and learning new stuff: this week new stuff is called QEMU-KVM.&lt;br&gt;
Yesterday I also tried XenServer but to be honest I wasn&amp;rsquo;t impressed, it just look like to be an old version of CentOS minimal install with some custom repos and a fancy GUI.&lt;br&gt;
I played with it for just a bunch of hours, but the thing that just performing an installation on a software RAID-1 turned out to be a PITA to say the least is a clear sign that it&amp;rsquo;s not the best tool for &lt;em&gt;my&lt;/em&gt; needs.&lt;br&gt;
I swapped a couple of HDDs and in 2 minutes I went back to the already installed CentOS 6.4 with QEMU+KVM.&lt;br&gt;
The client machine, for what it matters, is my Fedora 19 x86_64 workstation, virsh and virt-manager the tools I use for remote administration tasks.&lt;br&gt;
Installing QEMU-KVM is just a matter of typing &lt;code&gt;yum install libvirtd qemu-kvm bla bla bla&lt;/code&gt;, &lt;code&gt;chkconfig libvirtd on&lt;/code&gt; and doing a system reboot (better safe than sorry).&lt;br&gt;
The tricky part &lt;em&gt;at least for me&lt;/em&gt; was setting up a damn bridged network interface, luckily I found &lt;!-- raw HTML omitted --&gt;this&lt;!-- raw HTML omitted --&gt; great writeup.&lt;br&gt;
I am going to report here what I did to setup a couple of bridged network interfaces on my setup.&lt;/p&gt;</description></item><item><title>nginx and TLS v1.2</title><link>https://nagg.eu/nginx-and-tls-v1-2/</link><pubDate>Sat, 10 Aug 2013 14:03:39 +0000</pubDate><guid>https://nagg.eu/nginx-and-tls-v1-2/</guid><description>&lt;p&gt;Given that SSL and TLS, especially v1.0, suffer from serious security issues (e.g. &lt;!-- raw HTML omitted --&gt;&lt;a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS"&gt;https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS&lt;/a&gt;&lt;!-- raw HTML omitted --&gt;) I thought it would be a good idea to use the latest and more secure version of it: v1.2.&lt;br&gt;
On CentOS 6.4 the openssl version included is quite old and doesn&amp;rsquo;t support TLS v1.1 and 1.2.&lt;br&gt;
So, first of all we have to install the latest version 1.0.1e, it can be done compiling from sources or by adding a third party repository; I chose the latter.&lt;/p&gt;</description></item><item><title>WordPress admin, SSL, Apache + nginx</title><link>https://nagg.eu/wordpress-admin-ssl-apache-nginx/</link><pubDate>Tue, 30 Jul 2013 15:49:37 +0000</pubDate><guid>https://nagg.eu/wordpress-admin-ssl-apache-nginx/</guid><description>&lt;p&gt;Let&amp;rsquo;s say we have a WordPress blog and we would like to encrypt our login pages and the whole back-end of the site.&lt;br&gt;
There are many ways to do it, but since I already have a nginx instance configured as reverse proxy running in front of Apache I&amp;rsquo;ll use it to &lt;code&gt;protect&lt;/code&gt; my admin pages and logins.&lt;br&gt;
In this page I&amp;rsquo;ll not cover Apache&amp;rsquo;s configuration, which, by the way, is trivial to say the least, so please refer to this other post: &lt;!-- raw HTML omitted --&gt;Apache + nginx as reverse proxy&lt;!-- raw HTML omitted --&gt;.&lt;br&gt;
Using the configuration posted in the above&amp;rsquo;s link as starting point, to add SSL encryption to admin pages we should add a couple more bunch of lines of code.&lt;br&gt;
First of all, we must create our own Certificate Authority and issue a SSL certificate.&lt;br&gt;
Another option is buying a certificate, but I don&amp;rsquo;t trust CA (certificate forgery anyone?) and I don&amp;rsquo;t mind having a properly signed certificate for a page I am the only one accessing to.&lt;br&gt;
Follows a brief explanation on how to create a CA and issue a certificate.&lt;/p&gt;</description></item><item><title>OpenVPN server and CentOS</title><link>https://nagg.eu/openvpn-server-and-centos/</link><pubDate>Sun, 19 May 2013 17:52:52 +0000</pubDate><guid>https://nagg.eu/openvpn-server-and-centos/</guid><description>&lt;p&gt;OpenVPN is the de facto standard VPN free open source software; it is widely
used, tested, well documented and also included in the CentOS repos (EPEL).&lt;/p&gt;
&lt;h2 id="-server-side-configuration"&gt;.:. Server side configuration&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;yum install openvpn easy-rsa dnsmasq
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When yum is done installing the required packages, copy the sample config file.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Uncomment/edit the following lines in /etc/openvpn/server.conf:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh4096.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push &amp;#34;redirect-gateway def1&amp;#34;
push &amp;#34;dhcp-option DNS 10.8.0.1&amp;#34;
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA256
auth SHA512
cipher AES-256-GCM
#comp-lzo # Disable LZO compression
persist-key
persist-tun
status openvpn-status.log
;log openvpn.log # disable log, optional
;log-append openvpn.log # disable log, optional
user nobody
group nobody
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, create two folders easy-rsa/keys in /etc/openvpn and copy some files into
them:&lt;/p&gt;</description></item><item><title>XRDP and CentOS 6</title><link>https://nagg.eu/xrdp-and-centos-6/</link><pubDate>Fri, 26 Apr 2013 14:30:32 +0000</pubDate><guid>https://nagg.eu/xrdp-and-centos-6/</guid><description>&lt;p&gt;Yesterday&amp;rsquo;s night I installed a test machine to play with KVM and some other stuff, obviously the OS of choice is the trusty CentOS.&lt;br&gt;
I did a pretty minimal net-install but decided to install gnome desktop environment anyway because why not, not that it will be of much use, but still.&lt;br&gt;
Anyway, since the machine is an headless server it&amp;rsquo;s mandatory to be able to control it remotely, like the past 2 or 3 times, I installed XRDP expecting everything will be fine and working without any problem.&lt;br&gt;
And here is when I was wrong.&lt;br&gt;
It&amp;rsquo;s been quite a long time since the last time I installed XRDP somewhere, but I clearly remember it working flawless without any kind of manual configuration.&lt;br&gt;
I did the usual &lt;code&gt;yum install xrdp&lt;/code&gt;, confirm the installation, bla bla bla, &lt;code&gt;service xrdp start&lt;/code&gt; and both &lt;code&gt;sesman&lt;/code&gt; and &lt;code&gt;xrdp&lt;/code&gt; started with no problem.&lt;br&gt;
Then, when I went back to my workstation (Fedora 18 x64) and tried to connect to the server using Remmina Remote Desktop Client at first it seems to be working but once I typed user ID, password and press OK I got prompted the following error:&lt;/p&gt;</description></item><item><title>Samba 4, simple directory sharing</title><link>https://nagg.eu/samba-4_simple_directory_sharing/</link><pubDate>Sat, 19 Jan 2013 17:23:11 +0000</pubDate><guid>https://nagg.eu/samba-4_simple_directory_sharing/</guid><description>&lt;p&gt;With Samba being the clusterfuck it is, every time a new version is released
you have to expect something to be messed up.&lt;br&gt;
This time they added a bunch of new features like MS Active Directory support,
too bad that now the simple directory sharing is broken/not working like it did
before.&lt;br&gt;
Something like 1 year ago I wrote a small guide about how to setup a Samba
share on Centos 6 and I used the same smb.conf file on more than 10 machines
without any problem since yesterday, when I tried it on my fresh installed
Fedora 18 (which uses Samba 4.0.0). First of all, in the &amp;ldquo;Standalone Server
Options&amp;rdquo; is reported that &amp;ldquo;security&amp;rdquo; options &amp;ldquo;share and server&amp;rdquo; are deprecated;
too bad I just used &amp;ldquo;share&amp;rdquo; to save me the hassle of setting up a new user and
stuff even if I would like the directory to be fully accessible by everyone
without any restriction.&lt;br&gt;
I tried it anyway with &amp;ldquo;security = share&amp;rdquo; but there was no way to make the
folder accessible, when trying to access the Samba share I always got a popup
in which I had to login.&lt;br&gt;
So, at the end of the story, like it or not, I had to setup a new user, create
a samba user and edit the &amp;ldquo;smb.conf&amp;rdquo; file.&lt;/p&gt;</description></item></channel></rss>