背景:发现用ansible去做sudo时,发现权限不够:
TASK [irdcops : 修改 /etc/sudoers] ***********************************************
skipping: [10.70.37.24]
fatal: [10.70.36.172]: FAILED! => {"changed": false, "failed": true, "msg": "Could not replace file: /tmp/tmpfToWiS to /etc/sudoers: [Errno 1] Operation not permitted"}
fatal: [10.70.36.173]: FAILED! => {"changed": false, "failed": true, "msg": "Could not replace file: /tmp/tmpvA5FJh to /etc/sudoers: [Errno 1] Operation not permitted"}
[root@v-szq-Localizationweb13 etc]# chmod 755 sudoers
chmod: changing permissions of `sudoers': Operation not permitted
[root@v-szq-Localizationweb13 etc]# lsattr sudoers
----i--------e- sudoers
[root@v-szq-Localizationweb13 etc]# chattr -i sudoers
[root@v-szq-Localizationweb13 etc]# visudo
http://www.linuxeye.com/command/chattr.html
去掉保护命令:
黑客最容易修改这个sshd:
Form:http://jackxiang.com/post/1792/
TASK [irdcops : 修改 /etc/sudoers] ***********************************************
skipping: [10.70.37.24]
fatal: [10.70.36.172]: FAILED! => {"changed": false, "failed": true, "msg": "Could not replace file: /tmp/tmpfToWiS to /etc/sudoers: [Errno 1] Operation not permitted"}
fatal: [10.70.36.173]: FAILED! => {"changed": false, "failed": true, "msg": "Could not replace file: /tmp/tmpvA5FJh to /etc/sudoers: [Errno 1] Operation not permitted"}
[root@v-szq-Localizationweb13 etc]# chmod 755 sudoers
chmod: changing permissions of `sudoers': Operation not permitted
[root@v-szq-Localizationweb13 etc]# lsattr sudoers
----i--------e- sudoers
[root@v-szq-Localizationweb13 etc]# chattr -i sudoers
[root@v-szq-Localizationweb13 etc]# visudo
http://www.linuxeye.com/command/chattr.html
去掉保护命令:
黑客最容易修改这个sshd:
Form:http://jackxiang.com/post/1792/
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/8825/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2018-6-14 15:09
评论列表