chattr

前言

  • 开发机有sudo权限,但是非root用户
  • sudo 修改某文件,提示无权限
  • ls -al 显示  -rw-r--r-- 

lsattr

  • 看来只能用lsattr 看额外的属性了
  •  ----i--------e-  
  • 去除 i 属性   sudo chattr -i filename 
  • 修改完毕后,恢复文件的写保护状态   sudo chattr +i filename 

chattr i 属性

Immutable i +i to set
-i to clear[note 1]
  • A file with the i attribute cannot be modified.
  • It cannot be deleted or renamed, no link can be created to this file and no data can be written to the file.
  • When set, prevents, even the superuser, from erasing or changing the contents of the file.

posted on 2018-01-09 15:02  mdd_miley  阅读(102)  评论(0)    收藏  举报

导航