chcon: tidak dapat menerapkan konteks parsial ke file yang tidak berlabel saat menginstal nagios dengan SELinux

9

Saya menyiapkan inti Nagios di CentOS dengan SELINUX = menegakkan.

Saya mencoba lari

chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/

seperti yang disarankan dalam manual , tetapi saya mendapatkan pesan kesalahan ini:

chcon: can't apply partial context to unlabeled file `cmd.cgi'
chcon: can't apply partial context to unlabeled file `trends.cgi'
chcon: can't apply partial context to unlabeled file `histogram.cgi'
chcon: can't apply partial context to unlabeled file `avail.cgi'
chcon: can't apply partial context to unlabeled file `history.cgi'
chcon: can't apply partial context to unlabeled file `status.cgi'
chcon: can't apply partial context to unlabeled file `tac.cgi'
chcon: can't apply partial context to unlabeled file `showlog.cgi'
chcon: can't apply partial context to unlabeled file `notifications.cgi'
chcon: can't apply partial context to unlabeled file `extinfo.cgi'
chcon: can't apply partial context to unlabeled file `statuswml.cgi'
chcon: can't apply partial context to unlabeled file `outages.cgi'
chcon: can't apply partial context to unlabeled file `statuswrl.cgi'
chcon: can't apply partial context to unlabeled file `statusmap.cgi'
chcon: can't apply partial context to unlabeled file `config.cgi'
chcon: can't apply partial context to unlabeled file `summary.cgi'

Adakah cara untuk menghindari kesalahan ini?

Mohammed Shannaq
sumber
1
Beri label pada file? yaitu menambahkan label pengguna dan peran, selain dari label jenis.
ninjalj

Jawaban:

5

Anda perlu memberi label ulang file dengan tipe selinux yang tepat:

semanage fcontext -a -s system_u -t httpd_sys_script_exec_t /usr/local/nagios/sbin/*
Sergei Lomakov
sumber