How to edit my /etc/sysctl.conf file? [duplicate]
In one of the labs for learning Linux system administrator I have to do :
Now change the value by modifying
/etc/sysctl.confand force the system to activate this setting file without a reboot.Check that this worked properly.
here is what i must do:
Add the following line to
/etc/sysctl.conf:net.ipv4.icmp_echo_ignore_all=1and then do:
$ sysctl -p
how to do this and with which text editor?
11 Answer
1. You can add this line using nano or vim from terminal (ctrl+alt+t):
sudo nano /etc/sysctl.confwhere you then scroll down and add the line by hand then press ctrl+x to end editing. You will be asked if you want to save, confirm that by pressing y and then once return to save.
Same way you can reverse your changes.
2. You can add it as well this way:
echo "net.ipv4.icmp_echo_ignore_all=1" | sudo tee -a /etc/sysctl.confFor reversing this refer to solution 1.
1