./1.py
Traceback (most recent call last):
File "./1.py", line 8, in <module>
os.chown(path,998,-1)
OSError: [Errno 1] Operation not permitted: 'e2.py'
------------------------------------------------------------------
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os,sys,stat,__future__
path = "e2.py"
# 为文件设置标记,使得它不能被重命名和删除
os.chown(path,998,-1)
------------------------------------------------------------------
切换为root用户执行即可