Linux:关闭地址随机化

确认ASLR是否已经被打开,"2"表示已经打开

shanks@shanks-ubuntu:/home/shanks# cat /proc/sys/kernel/randomize_va_space 
2

切换到root用户来做更新,直接使用sudo会出现下面结果

shanks@shanks-ubuntu:~$ sudo echo 0 > /proc/sys/kernel/randomize_va_space 
bash: /proc/sys/kernel/randomize_va_space: Permission denied


要确认root已经被解锁,否则是切换不到root下的

shanks@shanks-ubuntu:~$ su
Password: 
su: Authentication failure


解锁root,可采用以下方式
shanks@shanks-ubuntu:~$ sudo passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully


切换至root下关闭ASLR
shanks@shanks-ubuntu:~$ su
Password: 
root@shanks-ubuntu:/home/shanks# echo 0 > /proc/sys/kernel/randomize_va_space 
root@shanks-ubuntu:/home/shanks# cat /proc/sys/kernel/randomize_va_space 
0
--------------------- 
作者:white_eyes 
来源:CSDN 
原文:https://blog.csdn.net/white_eyes/article/details/7169199 
版权声明:本文为博主原创文章,转载请附上博文链接!

 

你可能感兴趣的:(Linux)