Linuxに関する基礎知識
超基礎よりはちょい突っ込んだ内容
セキュリティに関する知識
まずはセキュリティの現状を確認する方法について
:primates> ls -l
-rw-r--r-- keeper prim 547 9:31 chimps
-rw-r--r-- keeper prim 983 9:32 gorillas
-rw-r--r-- keeper prim 485 9:34 sq_monks
この左端に書いてある-rw-r--r--などが現在のセキュリティを表している
--- --- ---
rwx rwx rwx
rはreadable(閲覧可能性)、wはwriteable(書き換え可能性)、xはexecutable(実行可能性)を表し、左のブロックから順にユーザー、グループ、他人を表す。例えば、世界中誰しもコードを書き換えられるようにしたいならば、---------を-------w-とすればよい。
実際に変える時のコード
では、実際にセキュリティ設定を変えたい時はどうしたらいいのか
設定を変える時はchmodコマンドを使う。また、ユーザーはu,グループはg,世界中のユーザーはoと定義する。
もし、世界中のユーザーにexecuteの権限を与えるとすると、
chmod o+xと打つ。
(others[o]に、execute[x]の権限を与える[+]という意味)
全部一気に与えたい場合は
chmod ugo+rwx
みたいな感じで打てば良い。