Skip to Content
Linux クックブック、第 2 版
book

Linux クックブック、第 2 版

by Carla Schroder
May 2025
Intermediate to advanced
544 pages
7h 23m
Japanese
O'Reilly Media, Inc.
Content preview from Linux クックブック、第 2 版

第6章 ファイルとディレクトリの管理 ファイルとディレクトリを管理する

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

Linuxは、構成可能な特権を持つファイルやディレクトリへのアクセスに対して、強力な基本制御を提供する。すべてのファイルとディレクトリには、ユーザ、グループ、その他を含む3つの所有レベルと、読み取り、書き込み、実行を含む複数のアクセスレベルがある。個人的なファイルを保護し、誰がアクセスできるかを制御することができ、ルート・ユーザはコマンド、スクリプト、共有ファイル、システム・ファイルへのアクセスを管理できる。

SELinuxやAppArmorのような、より強力なアクセス制御ツールを使う場合でも、基本を正しく理解することは重要である。

Linuxシステムでは、人間のユーザとシステム・サービスの両方がユーザ・アカウントを持っている。 システム・サービスの中には、人間のユーザと同じように、特権を制御するためにユーザ・アカウントを必要とするものがある。

すべての ファイルには、オーナー、グループ、その他(その他を ワールドと表すこともある)の3種類の所有権がある。オーナーは1人のユーザ、グループオーナーは1つのグループ、その他はファイルにアクセスできるすべての人である。

すべての ファイルには、読み取り、書き込み、実行可能の6つのパーミッションモードと、スティッキービットsetuidsetgidの3つの特殊化モードがある。

ファイル・パーミッションどのユーザがファイルを作成、読み取り、編集、削除できるか、どのユーザがコマン ドを実行できるかを制御する。特殊化モードは、誰がファイルを移動、削除、リネームできるかを制御し、誰が昇格権限でコマンドを実行できるかを制御する。

ディレクトリパーミッションどのユーザがディレクトリを編集、またはディレクトリに入ることができ、誰がディレクトリからファイルを読み取り、編集、追加、または削除できるかを制御する。

Linuxの基本的なセキュリティ原則である、「仕事をこなすために必要最小限の権限を使う」ということを忘れないでほしい。

特権の制限

ファイルを読み取れる人なら誰でもコピーできる。

rootユーザや、十分な権限を持つsudoユーザがファイルにアクセスできないようにすることはできない。

パーミッションと所有権はファイルシステムの関数であり、リムーバブル・メディアからライブLinuxを起動してホスト・システムにアクセスしたり、ハードドライブを取り外して別のマシンに接続するなど、別のLinuxインスタンスからストレージ・デバイスを読み取ることでバイパスできる。必要なのは、ストレージ・デバイスをマウントするシステムのroot権限だけで、元のファイルの所有者やパーミッションについては何も知る必要はない。

Linuxシステムでは、スーパーユーザーとも呼ばれるrootユーザーが頂点に君臨する。rootは、他のユーザーのファイルを編集・削除したり、任意のディレクトリに入ったり、任意のコマンドを実行したりと、ほとんど何でもできる。通常の、あるいは特権を持たないユーザは、sudoコマンドやsuコマンドを使って一時的にroot権限になることができる(レシピ5.17と 5.18を参照)。

すべてのユーザは一意なID(UID)を持ち、少なくとも1つのグループに属している(レシピ5.1参照)。グループ内のすべてのユーザは、そのグループの ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
Bash クックブック第2版

Bash クックブック第2版

Carl Albing, JP Vossen
行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

Stephen Wendel, 武山 政直, 相島 雅樹, 反中 望, 松村 草也

Publisher Resources

ISBN: 9798341650091