0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linux ユーザ権限・アクセス権

Posted at

ユーザ権限とアクセス権

ファイルの作成者のユーザIDとグループIDがファイルの所有者と所有グループとなる。

所有者の変更

chownコマンド

chown ユーザ[.グループ] ディレクトリorファイル

ユーザとグループを変更するには、rootユーザである必要がある

所有グループの変更

chgrp グループ ディレクトリorファイル

ファイルとアクセス権

ファイルの権限を設定できる3つのユーザ
①ファイルを所有するユーザ
②ファイル所有グループからファイル所有者を除いたユーザ
③その他のユーザ

ファイルの3つの権限
読み(r)、書き(w)、実行(x)

アクセス権の変更

chmod モード ディレクトリorファイル
chmod 8進法表記モード ディレクトリorファイル

モードの場合
**u(所有ユーザ)、g(所有グループ)、o(その他のユーザ)に対して、r,w,xを設定したり(=)、加えたり(+)取り消したり(-)**できる。

8進法表記モードの場合
読み(r)=4
書き(w)=2
実行(x)=1

で表記する。

パーミッションを指定してファイル作成

umaskコマンド使用で、指定したパーミッションでファイル作成できる

umask [8進法のモードの値]

unmaskコマンドに続けて値をしてしなかった場合現在の値を表示できる。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?