I usually forget what apps I regularly use on a Linux terminal until I get a command not found error. This will act as my reference to remember to install these apps when using a new terminal. This is a work in progress and apps may be added or removed. Most of these apps are…
Category: Linux
Useful Linux CLI Commands
Edit crontab of user where www-data is the user Sync two directories. This overwrites files with the same names Show information about a file or directory Show file or directory size Zip up a directory Unzip file to current directory List files and directories in a zip file Search for “whatever” in file.txt Run last…
Only allow certain IPs to access your Apache2/nginx web server
Use the following statements in your conf files. IPs are in CIDR format. Replace with your IP ranges as needed. Apache 2.4 Apache 2.2 nginx
Create a shared SFTP chroot directory for multiple users
These are instructions to create a shared directory amongst two or more users. This will only allow those users access to SFTP, but not the shell. They will also be “jailed” to the directory of your choosing. These examples were done using Ubuntu 22.04 and assume that you are root or using sudo. You are…
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: Create a user that corresponds to your username in Duo. Add your user to sudo group (Ubuntu) or wheel group (RedHat) Install the…
LibreNMS – Notes On Upgrading from Ubuntu 20.04 to 22.04
These are the steps that need to be done when doing an in-place Ubuntu upgrade on a LibreNMS system using do-release-upgrade. Running daily.sh in /opt/librenms should give you most of the errors you need to fix that we will go through in this guide. Most commands here will assume you are running as root or…
Expand Logical volume in Linux LVM
LVM makes it easy to resize volumes in Linux. This can be done without unmounting drives orrequiring a restart. First determine the free space of the group volume. First determine the partition where your OS is installed. Expand the partition. Here we will assume that the partition is sda3. You can view the volume grow…
Useful Tools
Link Compilation Linux Useful Commands Linux Tool Alternatives
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…