“About SELinux”版本间的差异
来自cslt Wiki
(以“semanage - SELinux Policy Management tool I introduce this command because several service need obtain the permission of SElinux. 2 example: * change mysql datadir....”为内容创建页面) |
|||
第1行: | 第1行: | ||
semanage - SELinux Policy Management tool | semanage - SELinux Policy Management tool | ||
+ | |||
I introduce this command because several service need obtain the permission of SElinux. | I introduce this command because several service need obtain the permission of SElinux. | ||
+ | |||
2 example: | 2 example: | ||
* change mysql datadir. | * change mysql datadir. |
2016年11月3日 (四) 04:06的版本
semanage - SELinux Policy Management tool
I introduce this command because several service need obtain the permission of SElinux.
2 example:
- change mysql datadir.
1) semanage fcontext -a -s system_u -t mysqld_db_t "/var/data/mysql(/.*)?" (/var/data/mysql is the datadir you want use) 2) restorecon -Rv /var/data/mysql
- grant www/apache to read files in a directory.
1) semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html(/.*)?' 2) restorecon -R /var/www/html