差分

移動先: 案内検索

ユーザ権限とアクセス制御

138 バイト除去, 2018年12月13日 (木) 17:49
/* ACL */
<syntaxhighlight langpre class="bash">
$touch foo.txt
$ ls -l foo.txt
-rw-rw-r-- 1 hironobu hironobu 0 Aug 31 08:15 foo.txt
</syntaxhighlightpre>
<syntaxhighlight langpre class="bash">
$ getfacl foo.txt
# file: foo.txt
group::rw-
other::r--
</syntaxhighlightpre>
<syntaxhighlight langpre class="bash">
$ chmod go-rw foo.txt
$ ls -l foo.txt
-rw------- 1 hironobu hironobu 0 Aug 31 08:15 foo.txt
</syntaxhighlightpre>
<syntaxhighlight langpre class="bash">
$ setfacl -m user:www-data:r foo.txt
</syntaxhighlightpre>
<syntaxhighlight langpre class="bash">
$ getfacl foo.txt
# file: foo.txt
mask::r--
other::---
</syntaxhighlightpre>
<syntaxhighlight langpre class="bash">
% ls -l foo.txt
-rw-r-----+ 1 hironobu hironobu 0 Aug 31 08:15 foo.txt
</syntaxhighlightpre>