給大家分享一些云計(jì)算學(xué)習(xí)路線課程大綱資料,這篇文章是關(guān)于文件屬性 chattr的一些資料,希望能給大家一些幫助:
文件權(quán)限管理之: 文件屬性
注:設(shè)置文件屬性(權(quán)限),針對(duì)所有用戶,包括root
[root@tianyun ~]# touch file100 file200
[root@tianyun ~]# lsattr file100 file200
-------------e- file100
-------------e- file200
[root@tianyun ~]# man chattr att屬性
[root@tianyun ~]# chattr +a file100
[root@tianyun ~]# chattr +i file200
[root@tianyun ~]# lsattr file100 file200
-----a-------e- file100 a屬只能夠追加 不可以寫(xiě)
----i--------e- file200
[root@tianyun ~]# echo 111 > file100 //以覆蓋的方式寫(xiě)入
bash: file100: Operation not permitted
[root@tianyun ~]# rm -rf file100
rm: cannot remove `file100': Operation not permitted
[root@tianyun ~]# echo 111 >> file100 //以追加的方式寫(xiě)入,例如日志文件 適用于日志
[root@tianyun ~]# echo 111 > file200 i 屬性 不可以改變文件 適用于 /etc/suders /passwd 文件只能看
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
分享名稱:云計(jì)算學(xué)習(xí)路線課程大綱資料:文件屬性chattr-創(chuàng)新互聯(lián)
分享網(wǎng)址:http://chinadenli.net/article22/dcpijc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、自適應(yīng)網(wǎng)站、App開(kāi)發(fā)、App設(shè)計(jì)、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容