Which versions of Ubuntu share /etc/sysctl.conf compatibility? [closed]

I am looking to secure my Ubuntu 18.04 LTS server and have found a nice script but it was designed for Ubuntu 20.04 LTS which includes changes to /etc/sysctl.conf. Which versions of Ubuntu (or linux in general) share /etc/sysctl.conf compatibility? Can I use the script's /etc/sysctl.conf for Ubuntu 20.04 on my Ubuntu 18.04?


Solution 1:

Instead, spend effort upgrading the distro, and getting applications to work on 20.04. As an added bonus, this gains you 2 more years of life.

Read sysctl documentation to get an idea about what each tunable the script tweaks does.

There is no guarantee that kernel settings are relevant or do the same thing to a previous version. In general, most are. sysctl, as a user interface to kernel settings, is relatively stable.

As a practical matter, write your settings to a drop in file, such as /etc/sysctl.d/tune.conf Very easy to install, compared to inserting lines in an existing file.