LoginSignup
2
3

More than 5 years have passed since last update.

[Linux]ファイルの拡張属性に設定されたSELinuxのセキュリティコンテキストを削除する

Posted at

実行したいこと

CentOS6以降で、SELinuxを無効にする前から存在したファイルにはファイルのパーミッションにドット"."がついたままなので、削除する

実行するコマンド

rootユーザーで以下のコマンドを実行する

指定したファイルのSELinuxセキュリティコンテキストを削除する場合、以下のコマンドを実行する
# setfattr -x security.selinux {ファイル名}

カレントディレクトリ以下で、複数のファイルに対し一括で実行したい場合は、以下のコマンドを実行する
# find . -exec setfattr -x security.selinux {} \;

参考URL

以下の記事を参考にしました
http://tkak.hatenablog.com/entry/2013/01/04/151248

2
3
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
2
3