Skip to main content

Unit 8 路 System Settings and the Final Run 路 Lesson 22 of 25

Two System Settings

Checking them, fixing them, and finding the file that keeps putting them back.

Two settings, both worth points

sysctl kernel.randomize_va_space net.ipv4.ip_forward
SettingShould beWhat it does
kernel.randomize_va_space2loads programs at a different place in memory each time, which breaks most memory attacks
net.ipv4.ip_forward0stops this machine passing other people's network traffic along

Change them now

sudo sysctl -w kernel.randomize_va_space=2
sudo sysctl -w net.ipv4.ip_forward=0

That takes effect immediately. It does not survive a restart, which is the next problem.

Find what keeps putting them back

ls /etc/sysctl.d/

Everything in that folder is applied at every restart. Ubuntu ships a couple of files here, so look for one that does not belong and open it:

sudo nano /etc/sysctl.d/FILENAME

If it sets either of the two settings above to the wrong value, delete the file:

sudo rm /etc/sysctl.d/FILENAME

馃挕 If a setting keeps coming back wrong after a restart, something is putting it back. Stop re-running the command and go find the file. This is the same shape as the problem in the next lesson.

Try it yourself

sysctl kernel.randomize_va_space net.ipv4.ip_forward   # what they are now
ls /etc/sysctl.d/                                       # what runs at every restart
sudo nano /etc/sysctl.d/FILENAME                        # read anything unfamiliar

Capture-the-flag challenge

Put the lesson to work on a challenge and submit the flag you find. Create a free account to do this part.

Do this lesson for real

With a free account you get the terminal, the challenges and the checks that go with every lesson in CyberPatriot Linux: Tokyo Jujutsu High, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.