Ubuntu关闭地址空间随机化(ASLR)的方法

确认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




你可能感兴趣的:(unix,ubuntu,bash,Authentication)