Skip to content

Instantly share code, notes, and snippets.

@mbodo
Last active October 1, 2016 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbodo/fdac46bb8493c21049cecd4b38a19780 to your computer and use it in GitHub Desktop.
Save mbodo/fdac46bb8493c21049cecd4b38a19780 to your computer and use it in GitHub Desktop.
Linux - RHEL Conf Tips

Linux - RHEL Conf Tips

Disable firewalld with systemctl

  • Check if service is running:

    systemctl status firewalld 
    
    ● firewalld.service - firewalld - dynamic firewall daemon
     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2016-09-19 07:59:20 BST; 1 weeks 2 days ago
    

Main PID: 960 (firewalld) Memory: 24.1M CGroup: /system.slice/firewalld.service └─960 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid


In this case active/running see **active (running)**

- Disable RHEL 7 firewalld service

systemctl stop firewalld


and check the status

systemctl status firewalld


This is usefull in case of testing VM port binding (in this case *nginx to port 80*)

> Links: [how-to-stop-start-and-disable-enable-firewall-on-redhat-7-linux-system](https://linuxconfig.org/how-to-stop-start-and-disable-enable-firewall-on-redhat-7-linux-system)

## Disable selinux temporalily

echo 0 > /selinux/enforce


Will remain switched off until next reboot.

## Disable selinux pernamently

vim /etc/sysconfig/selinux


SELINUX=disabled


Than restart the server.

Check:

sestatus


Should look like

SELinux status: disabled


> Links: [http://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/] (http://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/)

## Change security limits

In case we need to change the default values for num. of opened processes, files etc.

vim /etc/security/limits.conf


e.g (TODO add desctiption)
  •           hard    nofile            65536
    
  •           soft    nofile            65536
    
  •           hard    nproc            10000
    
  •           soft    nproc            10000
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment