{"id":5003,"date":"2015-08-02T16:56:13","date_gmt":"2015-08-02T08:56:13","guid":{"rendered":"http:\/\/rmohan.com\/?p=5003"},"modified":"2015-08-03T17:22:39","modified_gmt":"2015-08-03T09:22:39","slug":"centos-7-redhat-installation-best-practice","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5003","title":{"rendered":"CentOS  7 &#8211; Redhat Installation Best practice"},"content":{"rendered":"<h1 id=\"linux_centos_-_redhat_installation_best_practice\" class=\"sectionedit1\">Partitioning<\/h1>\n<div class=\"level2\">\n<p>By separating file systems into various partitions, you can fine tune permissions and functionality. Doing so will provide you greater granularity for permissions, as well as adding a layer of security for any potential bad guys to work through.<\/p>\n<p>Steve Grubb suggests, and quite rightly so, that areas where users have write privileges be kept on their own partition. This allows you to prevent hard link privilege escalation attempts, prevent creative device additions, and other unsavory behavior.<\/p>\n<p>Once you have your partitions broken out and sized accordingly, you can begin to restrict the various mount points as much as possible. You should add nodev, noexec, and nosuid wherever possible. An example of a decently restricted \/etc\/fstab file is below:<\/p>\n<pre class=\"code\">  Disk OS with LVM (required)\r\n  Disks data with LVM (required)<\/pre>\n<div class=\"table sectionedit3\">\n<table class=\"inline\">\n<tbody>\n<tr class=\"row0\">\n<th class=\"col0\"><\/th>\n<th class=\"col1\">type<\/th>\n<th class=\"col2\">name<\/th>\n<th class=\"col3\">size<\/th>\n<th class=\"col4\">mount point<\/th>\n<\/tr>\n<tr class=\"row1\">\n<td class=\"col0\">disk 1 (18GB)<\/td>\n<td class=\"col1\">static<\/td>\n<td class=\"col2\">\/dev\/sda1<\/td>\n<td class=\"col3\">512M<\/td>\n<td class=\"col4\">\/boot<\/td>\n<\/tr>\n<tr class=\"row2\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-root<\/td>\n<td class=\"col3\">2G<\/td>\n<td class=\"col4\">\/<\/td>\n<\/tr>\n<tr class=\"row3\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-usr<\/td>\n<td class=\"col3\">6G<\/td>\n<td class=\"col4\">\/usr<\/td>\n<\/tr>\n<tr class=\"row4\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-var<\/td>\n<td class=\"col3\">2G<\/td>\n<td class=\"col4\">\/var<\/td>\n<\/tr>\n<tr class=\"row5\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-opt<\/td>\n<td class=\"col3\">1G<\/td>\n<td class=\"col4\">\/opt<\/td>\n<\/tr>\n<tr class=\"row6\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-tmp<\/td>\n<td class=\"col3\">2G<\/td>\n<td class=\"col4\">\/tmp<\/td>\n<\/tr>\n<tr class=\"row7\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-home<\/td>\n<td class=\"col3\">2G<\/td>\n<td class=\"col4\">\/home<\/td>\n<\/tr>\n<tr class=\"row8\">\n<td class=\"col0\"><\/td>\n<td class=\"col1\">LVM<\/td>\n<td class=\"col2\">\/dev\/mapper\/rootvg-swap<\/td>\n<td class=\"col3\">2G<\/td>\n<td class=\"col4\">swap<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>|disk2|LVM|\/dev\/mapper\/datavg-data|10G|\/data|<\/p>\n<\/div>\n<h3 id=\"modifying_fstab\" class=\"sectionedit4\">Modifying fstab<\/h3>\n<div class=\"level3\">\n<p>Once you have your partitions broken out and sized accordingly, you can begin to restrict the various mount points as much as possible. You should add nodev, noexec, and nosuid wherever possible.<\/p>\n<p><strong>An example of a decently restricted \/etc\/fstab file is below:<\/strong><\/p>\n<pre class=\"code\">\/dev\/mapper\/rootvg-root \/                       ext4    defaults        1 1\r\n\/dev\/sda1               \/boot                   ext4    defaults,nosuid,noexec,nodev        1 2\r\n\/dev\/mapper\/rootvg-home \/home                   ext4    defaults,nosuid,nodev        1 2\r\n\/dev\/mapper\/rootvg-opt  \/opt                    ext4    defaults        1 2\r\n\/dev\/mapper\/rootvg-tmp  \/tmp                    ext4    defaults,nosuid,noexec,nodev        1 2\r\n\/dev\/mapper\/rootvg-usr  \/usr                    ext4    defaults        1 2\r\n\/dev\/mapper\/rootvg-var  \/var                    ext4    defaults,nosuid        1 2\r\n\/dev\/mapper\/rootvg-swap swap                    swap    defaults        0 0\r\n\/dev\/mapper\/reposvg-reposlv \/repos              ext4    defaults        1 2\r\n\/dev\/mapper\/reposvg-repcentoslv \/repos\/CentOS   ext4    defaults        1 2\r\n\/dev\/mapper\/reposvg-weblv        \/var\/www ext4      defaults,nosuid,nodev  1 2<\/pre>\n<\/div>\n<h2 id=\"install_additional_packages\" class=\"sectionedit5\">Install additional packages<\/h2>\n<div class=\"level2\">\n<p>Adapt the yum repositories in \/etc\/yum.repos.d\/ to be able to reach the right repositories<br \/>\nAdd ntp and net-tools (for ifconfig command), and other utilities<\/p>\n<pre class=\"code\">yum -y install ntp\r\nyum -y install telnet             #(client only to debug)\r\nyum -y install net-tools          #(ifconfig, arp, netstat)\r\nyum -y install lsof\r\nyum -y install mlocate            #(locate)\r\nyum -y install bind-utils         #(host, nslookup)\r\nyum -y install open-vm-tools      #(VMware Tools)\r\nyum -y install sg3_utils          #(scsi-rescan)\r\nyum -y install cpulimit           #(limit CPU usage per process)\r\nyum -y install nmap-ncat          # nc command<\/pre>\n<\/div>\n<h2 id=\"list_and_remove_unused_services\" class=\"sectionedit6\">List and remove unused services<\/h2>\n<div class=\"level2\">\n<p>On Redhat and CentOS 7, some services are interesting, but more related to mobility than static production, so I&#8217;ve disabled some services to replace by their older versions:<\/p>\n<p>NetworkManager.service (network service) I use <strong>network.service<\/strong><br \/>\nchronyd.service (NTP service) I use <strong>ntpd.service<\/strong><br \/>\nfirewalld.service (firewall service) I use <strong>iptable.service<\/strong> and <em>ip6tables.services<\/em><\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl list-unit-files | egrep -i \"firew|Network|chrony|postfix|tables|bluetooth\"<\/span>\r\n<span class=\"cli_output\">chrony-wait.service                        disabled<\/span>\r\n<span class=\"cli_output\">chronyd.service                            enabled<\/span>\r\n<span class=\"cli_output\">firewalld.service                          disabled<\/span>\r\n<span class=\"cli_output\">NetworkManager-dispatcher.service          disabled<\/span>\r\n<span class=\"cli_output\">NetworkManager-wait-online.service         disabled<\/span>\r\n<span class=\"cli_output\">NetworkManager.service                     disabled<\/span>\r\n<span class=\"cli_output\">postfix.service                            disabled<\/span>\r\n<span class=\"cli_output\">network-online.target                      static<\/span>\r\n<span class=\"cli_output\">network.target                             static<\/span>\r\n<span class=\"cli_output\">iptables.service                           disabled<\/span>\r\n<span class=\"cli_output\">ip6tables.service                          disabled<\/span>\r\n<span class=\"cli_output\">bluetooth.service                          disabled<\/span>\r\n<span class=\"cli_output\">bluetooth.target                           static<\/span>\r\n\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl list-units | grep network<\/span>\r\n<span class=\"cli_output\">network.service                               loaded active exited    LSB: Bring up\/down networking<\/span>\r\n<span class=\"cli_output\">rhel-import-state.service                     loaded active exited    Import network configuration from initramfs<\/span>\r\n<span class=\"cli_output\">network.target                                loaded active active    Network<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"disable_unused_services\" class=\"sectionedit7\">Disable unused services<\/h3>\n<div class=\"level3\">\n<p>Example of disable\/enable services:<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> for i in NetworkManager.service postfix.service firewalld.service chronyd.service bluetooth.service<\/span>\r\n<span class=\"cli_output\">do<\/span>\r\n<span class=\"cli_output\">systemctl disable $i<\/span>\r\n<span class=\"cli_output\">systemctl stop $i<\/span>\r\n<span class=\"cli_output\">done<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"install_ntp_package_and_enable_some_services\" class=\"sectionedit8\">Install ntp package and enable some services<\/h3>\n<div class=\"level3\">\n<p>network.service, ntpd.service, and if needed iptable.service<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> yum -y install ntp<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> for i in network.service ntpd.service iptable.service<\/span>\r\n<span class=\"cli_output\">do<\/span>\r\n<span class=\"cli_output\">systemctl enable $i<\/span>\r\n<span class=\"cli_output\">systemctl start $i<\/span>\r\n<span class=\"cli_output\">done<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl list-unit-files  | grep \"ntp\"<\/span>\r\n<span class=\"cli_output\">ntpd.service                               enabled<\/span>\r\n<span class=\"cli_output\">ntpdate.service                            disabled<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl list-units | grep \"netw\"<\/span>\r\n<span class=\"cli_output\">network.service                                 loaded active exited    LSB: Bring up\/down networking<\/span>\r\n<span class=\"cli_output\">network.target                                  loaded active active    Network<\/span>\r\n<\/pre>\n<p>Enable useful services if needed<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 scripts]#<\/span><span class=\"cli_command\"> systemctl enable httpd.service<\/span>\r\n<span class=\"cli_output\">ln -s '\/usr\/lib\/systemd\/system\/httpd.service' '\/etc\/systemd\/system\/multi-user.target.wants\/httpd.service'<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 scripts]#<\/span><span class=\"cli_command\"> systemctl start httpd.service<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"remove_services_that_are_in_listen_state\" class=\"sectionedit9\">Remove services that are in LISTEN state<\/h3>\n<div class=\"level3\">\n<p>In this example, you could disable the rpcbind.service<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> netstat -an | grep LIST<\/span>\r\n<span class=\"cli_output\">tcp        0      0 0.0.0.0:51579           0.0.0.0:*               LISTEN<\/span>\r\n<span class=\"cli_output\">tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN<\/span>\r\n<span class=\"cli_output\">tcp        0      0 192.168.22.136:80       0.0.0.0:*               LISTEN<\/span>\r\n<span class=\"cli_output\">tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     14412    @ISCSIADM_ABSTRACT_NAMESPACE<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     10242    \/run\/lvm\/lvmetad.socket<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16930    @\/tmp\/dbus-wEGN6K01Pn<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16307    \/tmp\/.X11-unix\/X0<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17599    \/tmp\/.ICE-unix\/1146<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     SEQPACKET  LISTENING     10256    \/run\/udev\/control<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     15164    \/var\/run\/lsm\/ipc\/sim<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     15166    \/var\/run\/lsm\/ipc\/simc<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     14413    @ISCSID_UIP_ABSTRACT_NAMESPACE<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     14414    \/var\/run\/avahi-daemon\/socket<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     14417    \/var\/run\/rpcbind.sock<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16306    @\/tmp\/.X11-unix\/X0<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     8042     \/run\/systemd\/private<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     18796    \/run\/user\/42\/pulse\/native<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     1388     \/run\/systemd\/journal\/stdout<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17778    \/var\/run\/rpcbind.sock<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     14458    \/var\/run\/dbus\/system_bus_socket<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     18556    \/var\/run\/libvirt\/libvirt-sock<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     18558    \/var\/run\/libvirt\/libvirt-sock-ro<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17598    @\/tmp\/.ICE-unix\/1146<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16036    \/var\/run\/abrt\/abrt.socket<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17418    @\/tmp\/dbus-0PYMRpYu<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16892    @\/tmp\/dbus-bKDTQeVf<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     16893    @\/tmp\/dbus-Skwj1TBB<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17543    @\/tmp\/dbus-qVKMoS2bff<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     18410    @\/tmp\/dbus-V9cHUqaM<\/span>\r\n<span class=\"cli_output\">unix  2      [ ACC ]     STREAM     LISTENING     17419    @\/tmp\/dbus-9XjDfCN8<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> lsof -i :111<\/span>\r\n<span class=\"cli_output\">COMMAND  PID USER   FD   TYPE DEVICE SIZE\/OFF NODE NAME<\/span>\r\n<span class=\"cli_output\">rpcbind 1243  rpc    7u  IPv4  17780      0t0  UDP *:sunrpc<\/span>\r\n<span class=\"cli_output\">rpcbind 1243  rpc    9u  IPv4  17782      0t0  TCP *:sunrpc (LISTEN)<\/span>\r\n<span class=\"cli_prompt\">[root@lstor2rrd ~]#<\/span><span class=\"cli_command\"> systemctl list-unit-files  | egrep -i \"rpc\"<\/span>\r\n<span class=\"cli_output\">var-lib-nfs-rpc_pipefs.mount               static<\/span>\r\n<span class=\"cli_output\">rpcbind.service                            enabled<\/span>\r\n<span class=\"cli_output\">rpcgssd.service                            disabled<\/span>\r\n<span class=\"cli_output\">rpcidmapd.service                          disabled<\/span>\r\n<span class=\"cli_output\">rpcsvcgssd.service                         disabled<\/span>\r\n<span class=\"cli_output\">rpcbind.socket                             enabled<\/span>\r\n<span class=\"cli_output\">rpcbind.target                             static<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl list-units  | egrep -i \"rpc\"<\/span>\r\n<span class=\"cli_output\">proc-fs-nfsd.mount                                                                               loaded active mounted   RPC Pipe File System<\/span>\r\n<span class=\"cli_output\">var-lib-nfs-rpc_pipefs.mount                                                                     loaded active mounted   RPC Pipe File System<\/span>\r\n<span class=\"cli_output\">rpcbind.service                                                                                  loaded active running   RPC bind service<\/span>\r\n<span class=\"cli_output\">rpcbind.socket                                                                                   loaded active running   RPCbind Server Activation Socket <\/span>\r\n<\/pre>\n<\/div>\n<h2 id=\"configure_the_network\" class=\"sectionedit10\">Configure the network<\/h2>\n<div class=\"level2\">\n<p>Change your ifcfg file located in \/etc\/sysconfig\/network-scripts\/, to add NM_CONTROLLED=no<br \/>\nEx:<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 network-scripts]#<\/span><span class=\"cli_command\"> cat \/etc\/sysconfig\/network-scripts\/ifcfg-eno16780032<\/span>\r\n<span class=\"cli_output\">TYPE=Ethernet<\/span>\r\n<span class=\"cli_output\">BOOTPROTO=none<\/span>\r\n<span class=\"cli_output\">DEFROUTE=yes<\/span>\r\n<span class=\"cli_output\">IPV4_FAILURE_FATAL=no<\/span>\r\n<span class=\"cli_output\">IPV6INIT=no<\/span>\r\n<span class=\"cli_output\">IPV6_AUTOCONF=no<\/span>\r\n<span class=\"cli_output\">IPV6_DEFROUTE=no<\/span>\r\n<span class=\"cli_output\">IPV6_FAILURE_FATAL=no<\/span>\r\n<span class=\"cli_output\">DEVICE=eno16780032<\/span>\r\n<span class=\"cli_output\">ONBOOT=yes<\/span>\r\n<span class=\"cli_output\">NM_CONTROLLED=no<\/span>\r\n<span class=\"cli_output\">IPADDR=192.168.1.19<\/span>\r\n<span class=\"cli_output\">NETMASK=255.255.255.0<\/span>\r\n<span class=\"cli_output\">GATEWAY=192.168.1.1<\/span>\r\n<span class=\"cli_output\">DNS1=192.168.1.10<\/span>\r\n<span class=\"cli_output\">DNS2=192.168.1.11<\/span>\r\n<span class=\"cli_output\">DOMAIN=centos.org<\/span>\r\n<span class=\"cli_output\">IPV6_PEERDNS=no<\/span>\r\n<span class=\"cli_output\">IPV6_PEERROUTES=no<\/span>\r\n<\/pre>\n<p>Disable NetworkManager , and enable old network service<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl disable NetworkManager.service<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> systemctl stop NetworkManager.service<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> chkconfig network on<\/span>\r\n<span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> chkconfig --list network<\/span>\r\n<span class=\"cli_output\">network         0:off   1:off   2:on    3:on    4:on    5:on    6:off<\/span>\r\n<\/pre>\n<p>Check your IP config and routes<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 sysctl.d]#<\/span><span class=\"cli_command\"> ip a<\/span>\r\n<span class=\"cli_output\">1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN<\/span>\r\n<span class=\"cli_output\">    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<\/span>\r\n<span class=\"cli_output\">    inet 127.0.0.1\/8 scope host lo<\/span>\r\n<span class=\"cli_output\">       valid_lft forever preferred_lft forever<\/span>\r\n<span class=\"cli_output\">2: eno16780032: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq state UP qlen 1000<\/span>\r\n<span class=\"cli_output\">    link\/ether 00:50:56:83:33:1e brd ff:ff:ff:ff:ff:ff<\/span>\r\n<span class=\"cli_output\">    inet 192.168.1.19\/24 brd 192.168.21.255 scope global eno16780032<\/span>\r\n<span class=\"cli_output\">       valid_lft forever preferred_lft forever<\/span>\r\n<span class=\"cli_prompt\">[root@lproxymail sysctl.d]#<\/span><span class=\"cli_command\"> ip route<\/span>\r\n<span class=\"cli_output\">default via 192.168.21.250 dev eno16780032<\/span>\r\n<span class=\"cli_output\">169.254.0.0\/16 dev eno16780032  scope link  metric 1002<\/span>\r\n<span class=\"cli_output\">192.168.21.0\/24 dev eno16780032  proto kernel  scope link  src 192.168.21.194<\/span>\r\n<\/pre>\n<p><strong>For information<\/strong> Due to new network adapter naming convention, you &#8216;ll find network interface called enp6s0 or enp4s2f0 doesn\u2019t satisfy everybody.<br \/>\nEx:<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> dmesg | grep NIC<\/span>\r\n<span class=\"cli_output\">[    2.318327] VMware vmxnet3 virtual NIC driver - version 1.1.30.0-k-NAPI<\/span>\r\n<span class=\"cli_output\">[    2.333886] vmxnet3 0000:0b:00.0 eth0: NIC Link is Up 10000 Mbps<\/span>\r\n<span class=\"cli_output\">[    3.373209] vmxnet3 0000:0b:00.0 eno16780032: NIC Link is Up 10000 Mbps<\/span>\r\n<\/pre>\n<p>You can switch to the old naming convention eth0, eth1\u2026 by changing boot parameters:<\/p>\n<pre class=\"code\">grubby --update-kernel=ALL --args=\"net.ifnames=0 biosdevname=0\"<\/pre>\n<\/div>\n<h2 id=\"stop_ipv6_best_practice\" class=\"sectionedit11\">Stop IPV6 best practice<\/h2>\n<div class=\"level2\"><\/div>\n<h3 id=\"disable_ipv6_on_network_adapter\" class=\"sectionedit12\">Disable IPV6 on network adapter<\/h3>\n<div class=\"level3\">\n<p>On most current <abbr title=\"Operating System\">OS<\/abbr>, IPV6 is activate by default. It wouldn&#8217;t be a good practice to completely unload the kernel module, but better disable it for most applications. You have to know that some application, like SELINUX will load IPV6 module if needed!<\/p>\n<p>Create a file \/etc\/sysctl.d\/98-disable_ipv6.conf<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> cat \/etc\/sysctl.d\/98-disable_ipv6.conf<\/span>\r\n<span class=\"cli_output\">net.ipv6.conf.all.disable_ipv6 = 1<\/span>\r\n<span class=\"cli_output\">net.ipv6.conf.default.disable_ipv6 = 1 <\/span>\r\n<\/pre>\n<p>To disable in the running system:<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> echo 1 &gt; \/proc\/sys\/net\/ipv6\/conf\/all\/disable_ipv6<\/span>\r\n<span class=\"cli_prompt\">[root@lstor2rrd ~]#<\/span><span class=\"cli_command\"> echo 1 &gt; \/proc\/sys\/net\/ipv6\/conf\/default\/disable_ipv6<\/span>\r\n<\/pre>\n<p>or<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">[root@centos7 ~]#<\/span><span class=\"cli_command\"> sysctl -w net.ipv6.conf.all.disable_ipv6=1<\/span>\r\n<span class=\"cli_prompt\">[root@lstor2rrd ~]#<\/span><span class=\"cli_command\"> sysctl -w net.ipv6.conf.default.disable_ipv6=1<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"disable_ipv6_on_ssh_server\" class=\"sectionedit13\">Disable IPV6 on SSH server<\/h3>\n<div class=\"level3\">\n<p>If problems with X forwarding are encountered on systems with IPv6 disabled, edit \/etc\/ssh\/sshd_config and make either of the following changes:<\/p>\n<p>(1) Change the line<\/p>\n<p>#AddressFamily any<\/p>\n<pre class=\"code\">to<\/pre>\n<p>AddressFamily inet<\/p>\n<p>(inet is ipv4 only; inet6 is ipv6 only)<\/p>\n<p>or<\/p>\n<p>(2) Remove the hash mark (#) in front of the line<\/p>\n<p>#ListenAddress 0.0.0.0<\/p>\n<p>Then restart ssh.<\/p>\n<pre class=\"code\">systemctl restart sshd.service<\/pre>\n<\/div>\n<h3 id=\"disable_ipv6_on_postfix\" class=\"sectionedit14\">Disable IPV6 on postfix<\/h3>\n<div class=\"level3\">\n<p>If problems with starting postfix are encountered on systems with IPv6 disabled, either<\/p>\n<p>edit \/etc\/postfix\/main.cf and comment out the localhost part of the config and use ipv4 loopback.<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">#<\/span><span class=\"cli_command\">inet_interfaces = localhost<\/span>\r\n<span class=\"cli_output\">inet_interfaces = 127.0.0.1<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"disable_ipv6_on_ntp_client\" class=\"sectionedit15\">Disable IPV6 on NTP client<\/h3>\n<div class=\"level3\">\n<p>Edit the file \/etc\/ntp.conf, and comment the line related to IPV6<\/p>\n<pre class=\"cli\"><span class=\"cli_prompt\">#<\/span><span class=\"cli_command\"> restrict ::1<\/span>\r\n<\/pre>\n<\/div>\n<h3 id=\"disable_ipv6_on_rpcbind\" class=\"sectionedit16\">Disable IPV6 on RPCBIND<\/h3>\n<div class=\"level3\">\n<p>To disable RPCBIND ipv6 (rpcbind, rpc.mountd, prc.statd) remark out the udp6 and tcp6 lines in \/etc\/netconfig:<\/p>\n<pre class=\"code\">udp        tpi_clts      v     inet     udp     -       -\r\ntcp        tpi_cots_ord  v     inet     tcp     -       -\r\n#udp6      tpi_clts      v     inet6    udp     -       -\r\n#tcp6      tpi_cots_ord  v     inet6    tcp     -       -\r\nrawip      tpi_raw       -     inet      -      -       -\r\nlocal      tpi_cots_ord  -     loopback  -      -       -\r\nunix       tpi_cots_ord  -     loopback  -      -       -<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Partitioning <\/p>\n<p>By separating file systems into various partitions, you can fine tune permissions and functionality. Doing so will provide you greater granularity for permissions, as well as adding a layer of security for any potential bad guys to work through.<\/p>\n<p>Steve Grubb suggests, and quite rightly so, that areas where users have write privileges be [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5003"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5003"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5003\/revisions"}],"predecessor-version":[{"id":5004,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5003\/revisions\/5004"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}