TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
✓
Angular
0%
✓
Astro
0%
✓
Svelte
0%
✓
Vue.js
0%
✓
Other
0%
✓
I only use React
0%
✓
I don't use JavaScript
0%
Linux / Storage

Etckeeper: Back Your/etc/Files to Git for Safekeeping

This tutorial will you how to install and use etckeeper so you can keep tabs on the comings and goings of your /etc/ directory.
Nov 2nd, 2024 7:00am by
Featued image for: Etckeeper: Back Your/etc/Files to Git for Safekeeping
Feature image via Unsplash.                                                                                    

In Linux, the /etc directory is of critical importance because it houses your system configuration files, such as hosts, crontabs, fstab, inittab, passwords, profiles, timezone data and so much more.

Simply put, without /etc, Linux wouldn’t function.

That’s why it’s important to treat that directory with the importance that it deserves. You could accidentally delete or configure a file in /etc/ and find your system behaving in an undesired way. Or maybe a bad actor has injected a malicious program onto your system that changes one or more configurations in /etc. If you are unaware that something has happened, the consequences could be catastrophic.

Because of this, you should keep a constant watch on the changes that occur in /etc. Of course, if your Linux system uses the Btrfs file system, you could always roll back the changes. Unfortunately, not every system makes use of Btrfs. If that describes your Linux servers or desktops, then you’ll want to know about etckeeper.

Etckeeper is a collection of tools used to monitor changes that occur within /etc. Etckeeper can use a Git, Mercurial, Bazaar or Darcs repository that is housed on your local machine (in /etc/.git) and is automatically updated daily.

I’ll show you how to install and use etckeeper so you, too, can keep tabs on the comings and goings of your /etc/ directory.

What You’ll Need

I’m going to demonstrate this on Ubuntu Server 22.04, but you can install the application on most Linux distributions from the standard repository. To follow along, you’ll need a running instance of Ubuntu server and a user with sudo privileges.

That’s it. Let’s install.

Installing etckeeper

Log in to your Ubuntu instance and open a terminal window (if necessary). Install the application with the command: