3.文件管理
本章同步视频:https://edu.51cto.com/sd/e4874
3.3.2 隐藏权限
-rw-r--r--. 1 root root 6 Mar 13 21:33 aaa
[root@localhost tmp]# echo "bbbb">aaa
-bash: aaa: Operation not permitted
#注:文件的拥有者且为root,明明具有写权限,却不能向aaa中写入数据。
[root@localhost tmp]# lsattr aaa
[root@localhost tmp]# chattr +a aaa
[root@localhost tmp]# echo "bbbb">aaa
-bash: aaa: Operation not permitted #写入失败
[root@localhost tmp]# echo "bbbb">>aaa #追加内容成功
[root@localhost tmp]# chattr -a aaa
[root@localhost tmp]# echo "bbbb">aaa
[root@localhost tmp]# chattr =i aaa
[root@localhost tmp]# echo "cccc">aaa
[root@localhost tmp]# echo "cccc">>aaa
[root@localhost tmp]# rm -f aaa
rm: cannot remove ‘aaa’: Operation not permitted