~/UnixCourse
You should be able to add and remove files from the directory, access files within the directory whose names you already know, and look through the directory via ls to see what files are in there. No one else should be able to do any of these things.
(This is a good setting for directories where you will keep assignments for various courses. After this assignment, your ~/UnixCourse directory should always be set this way.)
~/UnixCourse/fileAsst
You should be able to add and remove files from the directory, access files within the directory whose names you already know, and look through the directory via ls to see what files are in there. People in your group should be able to do ls and to access files, but not add/remove files from the directory. People outside your group should be able to do none of these things.
(Actually, no one but you will really have access to this directory because it’s inside ~/UnixCourse and, if you’ve done the prior step correctly, they can’t get inside there to get to fileAsst. But, for the sake of this exercise, we’ll ignore that fact.)
~/UnixCourse/fileAsst/Empire
You should be able to add and remove files from the directory, access files within the directory whose names you already know, and look through the directory via ls. Everyone else should be able to use ls but have no other privileges.
~/UnixCourse/fileAsst/Alliance
You should be able to add and remove files from the directory, access files within the directory whose names you already know, and look through the directory via ls. Everyone else should be able to access files in the directory for which they already know the names, but have no other privileges.
~/UnixCourse/fileAsst/Empire/darth.txt
Everyone should be able to read and write to this file.
~/UnixCourse/fileAsst/Alliance/r2d2.txt
We will pretend, for the sake of this assignment, that this file contains an executable program. You should be able to read and write to this file. You and members of your group should be able to execute it. People other than you have no other privileges.
これがこの問題に対する私の解決策です:
chmod 700 UnixCourse
chmod 740 fileAsst
chmod 744 ~/UnixCourse/fileAsst/Empire
chmod 666~/UnixCourse/fileAsst/Alliance
chmod 670~/UnixCourse/fileAsst/Empire/darth.txt
chmod 660~/UnixCourse/fileAsst/Alliance/r2d2.txt
unixcourseに対する保護は正しいですが、fileAsstに対する保護は私のグループメンバーのアクセスを許可しませんが、そうする必要があるというエラーが発生し続けます。 u(ユーザー)、g(グループ)、o(その他)、a(すべて)ごとに権限を追加し、権限を削除します。 4は読み取り、2は書き込み、1は実行です。
私は何を見逃していますか?
よろしくお願いします〜!
答え1
fileAsst
権限が740のディレクトリです。つまり、グループメンバー(所有者を除く)はコンテンツを読み取ることができますが、現在ディレクトリを作成するfileAsst
ことはできません。fileAsst
これにより、内のファイルを一覧表示できますが、fileAsst
そのファイルの詳細を表示できない奇妙な結果が発生します。
fileAsst
自宅で作成してファイルをpasswd
コピーした後、これらの権限を付与しました。したがって:
$ ls -l fileAsst/
ls: cannot access 'fileAsst/passwd': Permission denied
total 0
-????????? ? ? ? ? ? passwd
fileAsst
少なくとも実行権限(750または770)を付与する必要があります。