Source From Here
Question
How do I set sysctl variables (kernel parameters) under a Debian/Ubuntu or any Linux distributions using command line options?
How-To
You need to use the sysctl command which is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl command to both read and write sysctl variables.
You must login as the root user to use any one of the following command on a Linux operating systems.
Display Linux kernel parameters
The syntax is:
- Example: Check setting of variable net.ipv4.ip_forward
How do I set new values?
There are three methods to set new values for given kernel parameters as follows:
Method # 1: Setting value via procfs
You can use standard echo command to write data to variables (this temporary change):
Method # 2: Temporary on the command line
Use sysctl command with -w option when you want to change a sysctl setting:
Method # 3: Configuration file /etc/sysctl.conf
This is recommended way. First open /etc/sysctl.conf file, enter:
Question
How do I set sysctl variables (kernel parameters) under a Debian/Ubuntu or any Linux distributions using command line options?
How-To
You need to use the sysctl command which is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl command to both read and write sysctl variables.
You must login as the root user to use any one of the following command on a Linux operating systems.
Display Linux kernel parameters
The syntax is:
- Example: Check setting of variable net.ipv4.ip_forward
How do I set new values?
There are three methods to set new values for given kernel parameters as follows:
Method # 1: Setting value via procfs
You can use standard echo command to write data to variables (this temporary change):
Method # 2: Temporary on the command line
Use sysctl command with -w option when you want to change a sysctl setting:
Method # 3: Configuration file /etc/sysctl.conf
This is recommended way. First open /etc/sysctl.conf file, enter:
沒有留言:
張貼留言