
次のような出力が得られましたls -lFh
:
-rw-r--r-- 1 hjpotter92 hjpotter92 926 Aug 2 18:40 static.yaml
drwxr-xr-x 5 hjpotter92 hjpotter92 4.0K Sep 12 19:40 templates/
-rw-r--r-- 1 root root 1.5K Sep 12 20:09 xyz
私は としてログインしています。私のユーザーはリストにエントリがhjpotter92
ありません。以下を試したときの動作を説明できる方はいますか?NOPASSWD
sudoers
$ which rm
rm: aliased to rm -i
$ rm xyz
rm: remove write-protected regular file 'xyz'? y
$ sudo rm xyz
rm: cannot remove 'xyz': No such file or directory
$ ls -lFh
total 176K
<a lot of other files>
-rw-r--r-- 1 hjpotter92 hjpotter92 926 Aug 2 18:40 static.yaml
drwxr-xr-x 5 hjpotter92 hjpotter92 4.0K Sep 12 19:40 templates/
答え1
この場合、ファイルがあったディレクトリに対する重要な書き込み権限があります。したがって、ディレクトリに書き込みができる場合は、そこにあるファイルを削除することもできます。