LoginSignup
0
0

More than 1 year has passed since last update.

【Linux】ユーザー所有権、グループ所有権を変更する方法

Posted at

chownコマンドを使用すると、指定したファイルやディレクトリのユーザー所有権(所有者)や
グループ所有権(グループ)を変更することができる。

chown [オプション] ユーザー[:グループ] ファイル名

ファイルの情報を確認。

root@b1fb0a296712:/var/www# ls -lsa 
4 -rw-r--r-- 1 root  root  430 Sep 20 03:37 hoge_file.php

ユーザーもグループもrootになっている。

ユーザー所有者、グループ所有者をlaradockに変更する。

root@b1fb0a296712:/var/www# chown laradock:laradock hoge_file.php

再度ファイルの情報を確認。

root@b1fb0a296712:/var/www# ls -lsa
4 -rw-r--r-- 1 laradock laradock  430 Sep 20 03:37 hoge_file.php

ユーザー所有者、グループ所有者がlaradockに変更されている^^

参考:

0
0
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
0