Skip to main content

Posts

Showing posts with the label selinux

about getsebool and setsebool

The setsebool is used to set SELinux boolean value i.e. various configurations can be enabled or disabled using this tool. In other words, the setsebool command switches on and off the protection of SELinux. Type getsebool -a to see all such options which can be enabled or disabled at run time: e.g. # getsebool -a The following should give you a complete listing of all the vsftpd switches: e.g.  # getsebool -a | grep ftp  For example, if httpd_disable_trans set to 1, it will disable SELinux protection for  Apache web server. To disable it, enter:  # setsebool -P httpd_can_network_connect=1 To enable it, enter:    # setsebool -P httpd_can_network_connect=0

selinux not allowing vsftpd accessing homedir

enabling selinux policy for ftp access check the current status of selinux policy : # getenforce check the ftp policy status : # getsebool -a | grep ftp which usually returns the following output : allow_ftpd_anon_write –> off allow_ftpd_full_access –> off allow_ftpd_use_cifs –> off allow_ftpd_use_nfs –> off allow_tftp_anon_write –> off ftp_home_dir --> off                               (change that to on)                                                                    ...

how to enable httpd to access to homedir

here are the notes how to enable accessing homedir for httpd enable access to home user directory # /etc/httpd/conf/httpd.conf locate UserDir section <IfModule mod_userdir.c> # # # UserDir disabled                       (comments this line) # # to allow httpd accessing homedir set selinux by typing this command on terminal # setsebool -P httpd_enable_homedirs 1 # chcon -R -t httpd_sys_content_t ~username/public_html example. #  chcon -R -t httpd_sys_content_t ~belogix/public_html  notes: ~userid directory must have permission 711 ~userid/public_html/ directory must have permission 755 check your setting by open your web browser pointed to http://ipaddrwebserver/~user/

how to change rootdir vsftpd

as default root directory for vsftpd is located in /var/ftp/pub/. to change the defaults do this step : # /etc/vsftpd/vsftpd.conf add the line below anon_root = your_directory example anon_root = /home/user/ftp/ # /etc/selinux/config set selinux to disable/permissive mode

how to connect httpd service to mysqld service

connecting http service to mysql service this is tutorial to connecting htttpd and mysqld on separated pc (dedicated server) on this example information provides for the database server has ip address 192.168.1.100, and the web server has ip address 192.168.1.200 this tutorial is using oracle linux server 6 but this can be applied to rhel-based distributions on the database server pc access your server, $ mysql -u root mysql create new database, mysql>create database namedb; create database user, mysql>create user 'user'@'host_ip_addr_webserver' identified by 'password' note : use sign '%' at host if you want your database server to be accessed from any IP's give user created to access database, mysql>grant all on namedb.* to 'user'@'host_ip_addr_webserver'; mysql>flush privileges; mysql>exit edit iptables to open port tcp:3306 on the web server pc check first your pc can remotely access da...