OpenLDAP list all loaded schemas

- Posted in Linux by

ldapsearch -H ldapi:/// -Y EXTERNAL -b "cn=schema,cn=config" -LLL dn

Access to Linux Samba guest share from Windows 11 with guest account

- Posted in Windows by

To access to Linux a Samba guest share from Windows 11, ]the guest access has to be enabled by executing the following commands in PowerShell.

Set-SmbClientConfiguration -RequireSecuritySignature $false
Set-SmbClientConfiguration -EnableInsecureGuestLogons $true

The Linux Samba guest share is a share configured with guest only = Yes and guest ok = Yes. In the example below the access to the guest share is restricted by hosts allow = xxx.xxx.xxx.xxx and hosts deny = 0.0.0.0/0.

[public]
    path = /shares/public
    force group = public
    read only = No
    create mask = 0660
    directory mask = 0770
    **guest only = Yes
    guest ok = Yes**
    hosts allow = xxx.xxx.xxx.xxx
    hosts deny = 0.0.0.0/0

Linux Reset the display of strange characters after opening a binary file

- Posted in Linux by

In Linux to reset the display of strange characters after opening a binary file with cat or less commands, just execute the command reset, this resets the character maps and clears the screen.

Are you using Quad9 DNS

- Posted in Linux by

to check if you are using Quad9 DNS (primary DNS: 9.9.9.9, secondary DNS: 149.112.112.112), just visit this url from Quad9: https://on.quad9.net/.

Linux block incomming Tor connection

- Posted in Linux by

This posts explains how to block incoming tor connection using iptables and ipset. The first step is to obtain the tor exit nodes list, it could be downloaded from the https://opendbl.net/.

wget https://opendbl.net/lists/tor-exit.list

The second step is to install ipset and ipset-persistent packages and create an ipset list named torlist in which the tor exit nodes will be inserted using a small bash script.

apt install ipset ipset-persistent
ipset create torlist hash:ip

This script read list downloaded line by line check the validity of each IP address and insert it in the ipset list torlist that has been just created., finally the ipset list is saved in the file /etc/iptables/ipsets.

#!/bin/bash

while IFS= read -r ip; do

    [[ -z "$ip" || "$ip" =~ ^# || "$ip" ! =~  ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && continue

    ipset add torlist $ip -exist

done < "tor-exit.list"

ipset save > /etc/iptables/ipsets

The last step is to create an INPUT iptables rule placed as the first rule to drop the incoming Tor connections.

iptables -I INPUT 1 -m set --match-set torlist src -j DROP
iptables-save > /etc/iptables/rules.v4

UniFi Cloud Key Gen2

- Posted in Network by

The UniFi Cloud Key Gen2 Plus is an integrated hardware controller and self-contained application server designed to monitor and manage your UniFi network devices and camera surveillance system. It features an eight‑core processor with 3 GB RAM, a 1 TB SATA HDD for video storage, and 32 GB eMMC flash storage, and utilizes the latest version of the UniFi Controller with hybrid cloud technology.

The UniFi Cloud Key Gen2 Plus (UCK G2 Plus) stores its internal configurations, databases, and managed device profiles directly on its internal hard drive (HDD/SSD). Managed UniFi devices use a push-and-pull system for configuration:

The Master Copy: The complete, working configuration for every adopted switch, access point, and gateway is stored inside the MongoDB database running on the UCK G2 Plus hard drive.

The Device Copy: When you change a setting in the UniFi network application, the Cloud Key provisions the device. It pushes a compressed configuration file (historically called system.cfg) directly into the local flash memory of that specific hardware device.

Hardening Apache HTTP Server

- Posted in Linux by

Remove server version banner

The default configuration will expose Apache Version and OS type, to prevent it change the ServerTokens to Prod and ServerSignature to Off in the Apache configuration file /etc/apache2/apache2.conf.

sudo nano /etc/apache2/apache2.conf
ServerTokens Prod
ServerSignature Off
curl --head https://technicalnode.ddns.net
HTTP/1.0 500 Only GET and POST are supported
Date: Tue, 14 Jul 2026 01:05:48 GMT
Server: Apache
Set-Cookie: PHPSESSID=fq5ah1kg03f0p391lrooi04cpt; path=/; SameSite=strict
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Connection: close
Content-Type: text/html; charset=UTF-8

Enable HTTP Strict Transport Security (HSTS) for Apache

sudo a2enmod headers
nano /etc/apache2/sites-available/000-default-ssl.conf
<VirtualHost *:443>
        Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</VirtualHost>

Enable HTTP/2

sudo apt install php8.3-fpm
sudo a2enconf php8.3-fpm
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo a2enmod http2
/etc/apache2/mods-available/http2.conf
Protocols h2 h2c http/1.1