首页 > 其他分享 >chmod 报错 changing permissions of 'xxx': Operation not permitted

chmod 报错 changing permissions of 'xxx': Operation not permitted

时间:2022-09-22 17:11:43浏览次数:69  
标签:temp xxx chmod chattr 报错 ia

chmod 报错 changing permissions of 'xxx': Operation not permitted

问题

  1. 使用root创建了一个子用户,在home目录下创建对应的文件夹
  2. 更改文件夹的chown时报错

解决

  1. chmod的底层实现是chattr命令,用此命的功能更为强大,甚至可以锁定文件,即使root用户也操作不了此文件。

  2. 先使用lsattr查看文件属性

    lsattr temp
    # 
    ------ia-------e----- temp
    
  3. 去掉ia属性

    chattr -ia temp
    
  4. 然后正常执行chmod或者chown

  5. 恢复ia属性

    chattr +ia temp
    

标签:temp,xxx,chmod,chattr,报错,ia
From: https://www.cnblogs.com/outliver/p/16720011.html

相关文章