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

Cloud Computing Learning Route course syllabus material: file attributes chattr

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

Share

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

I'd like to share some information about the course outline of cloud computing learning route. This article is about the file attribute chattr. I hope I can give you some help:

File rights management: file attributes

Note: set file properties (permissions) for all users, including root

[root@tianyun ~] # touch file100 file200

[root@tianyun ~] # lsattr file100 file200

-e-file100

-e-file200

[root@tianyun ~] # man chattr att attribute

[root@tianyun ~] # chattr + a file100

[root@tianyun ~] # chattr + I file200

[root@tianyun ~] # lsattr file100 file200

-a mure-file100 a can only be appended but cannot be written

-iMure-file200

[root@tianyun ~] # echo 111 > file100 / / write in overwrite mode

Bash: file100: Operation not permitted

[root@tianyun ~] # rm-rf file100

Rm: cannot remove `file100': Operation not permitted

[root@tianyun ~] # echo 111 > > file100 / / write in an appended way, for example, log files are suitable for logs

[root@tianyun ~] # echo 111 > file200 I attribute cannot be changed for files applicable to / etc/suders / passwd files can only be viewed

Bash: file200: Permission denied

[root@instructor ~] # echo 111 > > file200

Bash: file200: Permission denied

[root@tianyun ~] # rm-rf file200

Rm: cannot remove `file200': Operation not permitted

[root@tianyun] # chattr-a file100

[root@tianyun] # chattr-I file200

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: 0

*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