mac sudo: /etc/sudoers is world writable

1.在Mac中啓動root 賬戶

https://jingyan.baidu.com/article/49711c619e7620fa441b7ca8.html

2.切換到root用戶,修改 /etc/sudoers的權限

 1 #無法使用chmod修改權限
 2 demo:Desktop piaoyu.qiu$ ls -la /etc/sudoers
 3 -rwxrwxrwx  1 root  wheel  1371  8  9 11:28 /etc/sudoers
 4 demo:Desktop piaoyu.qiu$ chmod 440 /etc/sudoers
 5 chmod: Unable to change file mode on /etc/sudoers: Operation not permitted
 6 
 7 #切換到root用戶
 8 demo:Desktop piaoyu.qiu$ su
 9 Password:你自己設置的密碼
10 sh-3.2# ls -l /etc/sudoers
11 -rwxrwxrwx  1 root  wheel  1371  8  9 11:28 /etc/sudoers
12 sh-3.2# chmod 0440 /etc/sudoers
13 sh-3.2# ls -l /etc/sudoers
14 -r--r-----  1 root  wheel  1371  8  9 11:28 /etc/sudoers
15 sh-3.2# exit
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章