![我不能再以 root 身份写入 /etc/resolvconf.conf 了吗?](https://linux22.com/image/146818/%E6%88%91%E4%B8%8D%E8%83%BD%E5%86%8D%E4%BB%A5%20root%20%E8%BA%AB%E4%BB%BD%E5%86%99%E5%85%A5%20%2Fetc%2Fresolvconf.conf%20%E4%BA%86%E5%90%97%EF%BC%9F.png)
几周前我编辑了 /etc/resolvconf.conf 添加了这一行:
name_servers="1.0.0.1 2606:4700:4700::1111,2606:4700:4700::1001"
今天,我再次回去编辑它,并sudo vim /etc/resolvconf.conf
以只读方式打开文件并覆盖w!
失败。我尝试过su
,sudo sh -c "vim /etc/resolvconf.conf"
并且没有任何效果。
ls -l /etc/resolvconf.conf
-rw-r--r-- 1 root root 320 Jan 4 00:05 /etc/resolvconf.conf
这里发生了什么事?这怎么可能?
答案1
希望该文件设置有不可变标志
去检查 :
lsattr /etc/resolvconf.conf
----i---------- /etc/resolvconf.conf
删除不可变标志
chattr -i /etc/resolvconf.conf