亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 2064 | 回復(fù): 3
打印 上一主題 下一主題

有沒(méi)有辦法讓軟鏈接不可刪除呢? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2010-11-09 21:48 |只看該作者 |倒序?yàn)g覽
例如 tmp ->/data/tmp 這樣一個(gè)軟鏈接,怎么才能改為只讀屬性。
chmod -w 或者 chattr -i 都不行,都只是操作/data/tmp的屬性了,沒(méi)法對(duì)tmp這個(gè)軟鏈接本身做操作。

有這樣的需求是因?yàn)樯a(chǎn)環(huán)境老是被刪除軟鏈接,crontab腳本太多,不知道哪個(gè)腳本干的;蛘哂修k法在被刪除的時(shí)候抓到是哪個(gè)進(jìn)程刪除的嗎?

論壇徽章:
15
2015年辭舊歲徽章
日期:2015-03-03 16:54:15雙魚座
日期:2015-01-15 17:29:44午馬
日期:2015-01-06 17:06:51子鼠
日期:2014-11-24 10:11:13寅虎
日期:2014-08-18 07:10:55酉雞
日期:2014-04-02 12:24:51雙子座
日期:2014-04-02 12:19:44天秤座
日期:2014-03-17 11:43:36亥豬
日期:2014-03-13 08:13:51未羊
日期:2014-03-11 12:42:03白羊座
日期:2013-11-20 10:15:18CU大;照
日期:2013-04-17 11:48:45
2 [報(bào)告]
發(fā)表于 2010-11-10 07:16 |只看該作者
cronjob 都是設(shè)在root里的嗎?

論壇徽章:
145
技術(shù)圖書徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11獅子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龍
日期:2014-01-08 15:26:12技術(shù)圖書徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
3 [報(bào)告]
發(fā)表于 2010-11-10 09:36 |只看該作者
本帖最后由 jason680 于 2010-11-10 09:38 編輯

chmod never changes the permissions of symbolic links; the chmod  sys-
       tem call cannot change their permissions.  This is not a problem since
       the permissions of symbolic links are never used.  However,  for  each
       symbolic  link  listed  on the command line, chmod changes the permis-
       sions of the pointed-to file.  In  contrast,  chmod  ignores  symbolic
       links encountered during recursive directory traversals.

STICKY FILES
       On  older  Unix  systems, the sticky bit caused executable files to be
       hoarded in swap space.  This feature is not useful on modern  VM  sys-
       tems,  and  the  Linux  kernel ignores the sticky bit on files.  Other
       kernels may use the sticky bit on files for  system-defined  purposes.
       On some systems, only the superuser can set the sticky bit on files.

STICKY DIRECTORIES
       When the sticky bit is set on a directory, files in that directory may
       be unlinked or renamed only by  root  or  their  owner.   Without  the
       sticky bit, anyone able to write to the directory can delete or rename
       files.  The sticky bit is commonly found on directories, such as /tmp,
       that are world-writable.

把連結(jié)檔案放至有sticky的目錄下(/ tmp目錄本身就是stcky目錄)下,
這樣只有root及owner(所有者)才能刪檔.

$ whoami
test

$ ls -l /home/t
-rwxrwxr-x  1 root test 8 Nov 10 09:22 /home/t

$ ls -l /tmp/t
lrwxrwxrwx  1 root root 7 Nov 10 09:21 /tmp/t -> /home/t

$ rm /tmp/t
rm: cannot remove `/tmp/t': Operation not permitted
#test不是/ tmp/t的owner,無(wú)法刪檔...

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2010-11-10 10:29 |只看該作者
樓上的指了條明路啊,馬上試試,謝了
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP