Wednesday, April 3, 2013

How to disable ASLR in linux permanently.

I was trying to install IBM DB2 v9.7 on the Ubuntu 12.10 and ./db2prereqcheck had been saying to me this:
DBT3534W  The db2prereqcheck utility determined that ASLR is set to ON and that this could cause issues with some tools.
Many articles in the Internat says that ASLR can be disabled by just executing this command in the bash:
sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
But this is not a permanent solution, you have to execute this command after every reboot of the machine.
Also in order to disable ASLR permanently there are some articles recommending to add
to the kernel boot parameters, but this won't work.
Finally I found the solution: simply add
to the end of the /etc/sysctl.conf. To immediately apply changes execute as root:
sysctl -p


  1. Thank you for the knowledge share. It resolved my issue :)

  2. I use a Linux VM for testing buffer overflows and was searching for a resolution to this. Thanks!

  3. Thanks for providing this informative information you may also refer.