[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
電腦觀點-初學者討論區 • 檢視主題 - 檔案(資料夾)權限簡介之初級篇

檔案(資料夾)權限簡介之初級篇

軟體的教學文章收錄於此,歡迎各界發表。

版主: hammer, baga80

檔案(資料夾)權限簡介之初級篇

文章ESWL » 週四 2月 01, 2007 5:56 pm

版權沒有;翻印不究。歡迎轉貼;註明出處即可!

寫在文章之前:
要進入[權限]的奧秘,你的作業系統必須是NT4;2K;XP PRO,必須是NTFS,必須採取傳統共用模式!


權限簡介初級篇

使用權限不是三言兩語可以說清楚的,
尤其是在加上使用者和群組關係時,更是錯縱複雜。

設定使用者權限;
要先弄清楚 <共用權限> 與 <安全性權限> 的不同。

本機登入只考慮 <安全性權限> ;無關 <共用權限>。

遠端存取(例如:網路芳鄰)則先看 <共用權限>,再和 <安全性權限>
做交集(也就是取其較嚴格的)。


假設你在某個資料夾要讓 [本機的其他使用者]
只讓他能:
1.可以看其中的檔案(讀取)
2.新增檔案或子資料夾(寫入)
3.更改已存在的檔案內容(寫入)
4.不可以刪除檔案或子資料夾

你對此資料夾該使用者的 <安全性權限>
就不能給其有 [修改][完全控制] 的權限,
只能給 [讀取及執行] + [寫入] + [清單資料夾內容]。

一旦給予至 [修改] 權限,他就一定有刪除的權限。

圖檔

還有一個很重要的觀念要釐清:
以同樣檔名的檔案來覆蓋原始檔案
在電腦是認為更改檔案內容
只需最少有到 [寫入] 的權限即可。

然而,把原始檔案更改檔名;而不改變其內容
在電腦卻認為是刪除原檔案後新增一個檔案!
這必須至少有 [修改] 的權限才可以實施的!!

所以,
如果你有一個資料夾是存放著非常重要的資料時,
建議你一再確認該資料夾「安全性」的有效帳戶,
只有你自己的帳戶擁有【完全控制】的權限,
其餘的本機帳戶給予[讀取] + [讀取及執行]即可!
如此可避免重要資料被修改或刪除的等不可預料的情形發生。
因為,根據「莫非定律」:主觀認為不會發生的事;就一定會發生,
而且一旦發生;通常都是最嚴重的情形!

還有,一台電腦在單機使用環境之下,切記除了Administrator外,
檯面上的登入帳戶擁有【系統管理員】權限的帳戶不要超過一個,
否則其他擁有【系統管理員】權限的帳戶,
可能會以取得檔案所有權的方式;重新設定讀取權限。

上述是單指本機多登入帳戶而言,如果是遠端存取呢?
我們以相同的例子來說明:

假設你在某個資料夾要讓 [網路芳鄰的使用者]
只讓他們能:
1.可以看其中的檔案(讀取)
2.新增檔案或子資料夾(寫入)
3.更改已存在的檔案內容(寫入)
4.不可以刪除檔案或子資料夾

因為遠端存取(例如:網路芳鄰)是先看 <共用權限>,
再和 <安全性權限>做交集(也就是取其較嚴格的)後才是有效權限。
以這個例子我們可以如此設定:

共用權限部份
你必須給該USER至少有 <變更> 的權限
圖檔

安全性權限部份:
你給予該USER只有 <寫入> 的權限
圖檔

如此設定之後,該USER在共用權限部份擁有 <變更> 的權限,
所以他能在該共享資料夾內新增及刪除檔案或子資料夾。

然而,他在安全性權限部份只擁有至 <寫入> 的權限,
所以他能新增檔案或子資料夾;卻不能刪除檔案或子資料夾。

因此,雖然他在共用權限部份擁有 <變更> 的權限,
但是在安全性權限部份卻沒有 <修改> 的權限。
我用表格來做整理;可能會比文字敘述更容易明白。

如下表:


----------------------共用權限<變更>-------安全性權限<寫入>

新增檔案或子資料夾----------可--------------------可

改變檔案內容----------------可--------------------可

刪除檔案或子資料夾-----------可-------------------不可


兩個權限作交集運算之後,取其較嚴格的限制之後得到這樣的結果:

可新增檔案或子資料夾;
可改變檔案內容;
不可刪除檔案或子資料夾 !

我們的目的達到了!


我知道你可能對權限一些名詞仍然有一些模糊,沒關係!我來做個整理:

完全控制--------→允許進行任何作業

修改------------→修改、刪除檔案(資料夾)內容,是僅次於完全控制的權限

讀取及執行------→讀取檔案外也可以執行其中的可執行檔

資料夾清單內容--→列出資料夾內的檔案名稱(這個權限為資料夾專用)

讀取------------→讀取檔案

寫入------------→可以修改檔案(資料夾)內容;但是不能刪除檔案(資料夾)


而資料夾『共用權限』中的「變更」,就是大約等於「修改」。

這其中就以 [修改] 最容易讓人混淆,
初學者很容易的依字面上想當然爾的認定:
我有一份檔案資料要讓同仁可以 {編輯更改} 其中的內容,所以要給他們有[修改] 的權限!這是相當大的誤解!!
[修改] 這個權限,
你可以把它想成是 [讀取及執行] 加上 [寫入] 再加上 [刪除] 的組合。
所以,它除了能{編輯更改}文件內容,也可以刪除整個文件或資料夾!

那你可能會說 [修改] 這裡我給它勾選 [拒絕] 不就得了?
NO! [拒絕] 這個命令不要顧名思義的隨便給它勾選,
在Windows NT系列裡 [拒絕] 的優先權大於 [允許] !
如上例:一旦勾選 [拒絕修改] 則連 [讀取及執行] 和 [寫入] 都一起拒絕了喔!
屆時該檔案是連看也不給人家看;更不要想說去編修或更改檔案了!

下回找時間我們再來聊如果除了使用者權限之外,
再加上群組權限時會有什麼情形發生!
圖檔

ESWL
進階初學者
進階初學者
 
文章: 106
註冊時間: 週五 1月 12, 2007 4:19 pm
來自: QA

回到 軟體教學文章

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 2 位訪客

cron