Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux: hidden attribute chattr of the file

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Chattr

The chattr command is used to set hidden permissions for files in the format "chattr [parameters] file".

Chattr-chattr +

Parameter action

I cannot modify the file; if this parameter is set for the directory, you can only modify the contents of the subfiles, but not create or delete the file

An only supplementary (appended) content is allowed, but cannot be overwritten / deleted (Append Only)

S file contents are synchronized to the hard disk (sync) immediately after the change

S is completely deleted from the hard disk and cannot be recovered (fill the hard disk area where the original file is located with 0)

A will no longer modify the last access time (atime) of this file or directory

B no longer modify the access time of files or directories

D check for errors in the compressed file

D ignore this file / directory when backing up using the dump command

C compress files or directories by default

U when the file is deleted, it still retains its data on the hard disk to facilitate future recovery

T let the file system support tail merging (tail-merging)

X can directly access the contents of the compressed file

[root@master1-192,168117-18] # cat / etc/shadow > fan

[root@master1-192,168117-18] # chattr + a fan

[root@master1-192,168117-18] # echo "wohaofan" > fan

-bash: fan: disallowed operation

[root@master1-192,168117-18] # echo "wohaofan" > > fan

Lsattr

[root@master1-192,168117-18 ~] # lsattr

-eMurt -. / 560_file

-eMurt -. / shadow.bak.bak

-eMurt -. / Example.sh

-eMurt -. / chkscore.sh

-eMurt -. / mkcdrom.sh

-a fan. /

-eMurt -. / jiuming

-eMurt -. / ipadds.txt

-eMurt -. / chkhost.sh

-eMurt -. / example.sh

-eMurt -. / users.txt

-eMurt -. / dead.letter

-eMurt -. / anaconda-ks.cfg

-eMurt -. / Guess.sh

-eMurt -. / profile.bak

-eMurt -. / profile.bak.tar.gz

-eMurt -. / linuxprobe

-eMurt -. / Checkkeys.sh

-eMurt -. /

-eMurt -. / 20191217

-eMurt -. / ChechHosts.sh

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 267

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report