Selinux blocking denyhosts

Kevin H. Hobbs hobbsk at ohio.edu
Sun May 29 12:02:06 UTC 2011


I tried to install and enable denyhosts on a fresh Fedora 15 install.

I did systemctl enable denyhosts.service. systemctl ran chkconfig.

When I started the service I got this in /var/log/messages:

May 29 07:49:33 murron setroubleshoot: SELinux is preventing 
/usr/bin/python from read access on the lnk_file /var/lock. For 
complete SELinux messages. run sealert -l 
fc8b6153-e359-409b-9310-9f0f3b3a20c7

sealert says:

SELinux is preventing /usr/bin/python from read access on the 
lnk_file /var/lock.

*****  Plugin restorecon (94.8 confidence) suggests  
*************************

If you want to fix the label.
/var/lock default label should be var_lock_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/lock

*****  Plugin catchall_labels (5.21 confidence) suggests  
********************

If you want to allow python to have read access on the lock lnk_file
Then you need to change the label on /var/lock
Do
# semanage fcontext -a -t FILE_TYPE '/var/lock'
where FILE_TYPE is one of the following: var_run_t, var_lock_t, 
bin_t, cert_t, usr_t, device_t, devlog_t, locale_t, abrt_t, 
etc_t, lib_t, proc_t, root_t, device_t, ld_so_t, proc_t, 
denyhosts_t, textrel_shlib_t, rpm_script_tmp_t, var_run_t.
Then execute:
restorecon -v '/var/lock'


*****  Plugin catchall (1.44 confidence) suggests  
***************************

If you believe that python should be allowed read access on the 
lock lnk_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep denyhosts.py /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


More information about the users mailing list