0

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?

Currn Hyde
  • 11
  • 1
  • 2
  • 1
    Ask the script maintainer. You did not provide enough information to answer your question. – Paul Nov 11 '21 at 15:56
  • 1
    Proper way to do such things is to add *override files* into `/etc/sysctl.conf.d/`. So in general, I'd advise you to **never** use scripts which change `/etc/sysctl.conf`, because this is the bad practice. – Nikita Kipriyanov Nov 16 '21 at 11:18

1 Answers1

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.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34