Link Compilation Linux Useful Commands Linux Tool Alternatives
Category: Linux
Allow SSH connections only from certain addresses using hosts.deny/hosts.allow
This is the method that can be used to allow SSH connections from certain IP networks. An example use for this is allowing SSH from certain public IP networks, as well as from my Tailscale network. If possible, it is probably better to use iptables/nftables/ufw or the firewall feature of your hosting provider if they…
Rate limit connections in Linux
Use the following iptables command to rate limit connections per IP. This is useful for preventing a DDoS attack on DNS servers. However, for DDoS protection for your DNS servers, you should be hosting DNS with the big cloud providers like Cloudflare, or running dnsdist in front of your authoritive servers.
Enable older SSH key exchange methods
When connecting via SSH to older systems who do not support newer ciphers, you will sometimes get the following error: To permanently enable support for this cipher, you need to add the following line to either/etc/ssh/ssh_config to enable it for all accounts or ~/.ssh/config for just your account. You can change Host * to specify…
Yarn Repository Expire Key Error
When using yarn through the apt repo, the key might expire, giving you the following error when updating apt. Issue the following command to update the key and then update the repository.
Create a .pfx/.p12 Certificate File Using OpenSSL
Source: https://www.ssl.com/how-to/create-a-pfx-p12-certificate-file-using-openssl/ The PKCS#12 or PFX format is a binary format for storing the server certificate, any intermediatecertificates, and the private key into a single encryptable file. PFX files are usually found with theextensions .pfx and .p12. PFX files are typically used on Windows and macOS machines to import andexport certificates and private keys. Requirements…
DB_VERSION_MISMATCH error when updating AlmaLinux 8 / RHEL 8 / Rocky Linux
When trying to update the operating system, you might receive an error similar to the following … This can be fixed with the following command to remove the existing database …
Add Duo Two-Factor auth to SSH in Ubuntu
Duo offers a relatively simple way to add support Duo two-factor auth to SSH sessions in multiple Linux Distributions. Here are my steps for Ubuntu Server. Create /etc/apt/sources.list.d/duosecurity.list with the following contents:deb [arch=amd64] https://pkg.duosecurity.com/Ubuntu focal main Create a user that corresponds to your username in Duo. Create admin group in Ubuntu.# groupadd admin Add your…
Disable the floppy drive module in Linux(Ubuntu)
Sometimes Linux will mistakenly detect a floppy device and create a reference to it because your system does not actually have a floppy drive and you will see errors on the login screen that look similar to blk_update_request: I/O error, dev fd0, sector 0. I find this frequently happens on a VMWare VM. This doesn’t…
Generate Certificate Signing Request (CSR) in Linux
Replace domain with your domain. domain.csr is what is used by your certificate authority togenerate your certificate. domain.key will be used by your web server in conjunction with yourcertificate.