Diary of an IT Architect

Copypastable tutorials I wrote for my reference. You're welcome.

Uploading websites to their document roots was traditionally done by means of FTP. FTP is an ancient beast which should probably be eradicated from the Internet, mostly because it uses cleartext communication for both authentication (meaning it's trivial to sniff out credentials on the wire) and data transfer (meaning it's prone to MITM attacks). However, a lot of old-school web programmers are used to their FTP clients, such as FileZilla, and not too eager to learn new stuff. This article explains how to set up ProFTPD server in SFTP mode listening on non-standard port, whose clients - virtual users - will be authenticated from MySQL database and chrooted to their directories. Virtual users won't have local shell access, as opposed to local users who can ssh to standard port provided by FreeBSD's built-in ssh server, but they will be able to transfer files securely without the need to move away from FileZilla.

Continue reading...

Large browser vendors have quite some time ago established model of "trusted" web sites based on SSL certificates signed by "trusted" CAs. This trend increasingly spreads to other applications and protocols. This article gives exact steps needed for obtaining Let's Encrypt's wildcard certificates from FreeBSD host, using DNS validation through dynamic updates of a BIND server's zones, using EFF's ACME client, certbot.

Continue reading...

For the last few years, I have been using net/openntpd instead of FreeBSD's base ntpd(8), exclusively because of the latter's tendency to bind to all available interfaces and addresses, and its inability to be configured in a way that it binds to specific IP address. Things have changed recently, however, and it appears that from FreeBSD 11.1 onwards we can specify ntpd's listen IP address(es). The following article explains how to bind FreeBSD's base ntpd to single IPv4 address, and IPv4 loopback address.

Continue reading...

Desktop environments on FreeBSD are usually started by some kind of display manager, such as GDM or KDM. This is specially true for “heavy” desktops such as GNOME or KDE, which are almost impossible to run without one. On the other side, “lighter” desktops such as XFCE run just fine without a display manager. Steps to start XFCE without login manager are described in FreeBSD Handbook, but they require that user logs in and starts X server manually. The following article describes how to start XFCE automatically immediately after user logs onto local console.

Continue reading...

Default FreeBSD installation will boot into command line login prompt, requiring users to log into the system before gaining access to the programs, which is usually done by typing username and password interactively. In some cases, however, we want to login certain user automatically on boot. Steps to accomplish this task are described in the following article.

Continue reading...