Difference between revisions of "New CentOS 7 Server Setup Commands"

From Labrats.us
Jump to navigationJump to search
(Created page with "== Install From Image, with 'minimal install' option == == Post install configuration == === Remove Network Manager software === <pre> # /bin/systemctl disable NetworkManag...")
 
Line 42: Line 42:
 
</pre>
 
</pre>
  
=== Disable selinux on the guest. ===
+
=== Disable selinux ===
  
 
<pre>
 
<pre>
 
# setenforce 0
 
# setenforce 0
# # sed -i.bak "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
+
# sed -i.bak "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
 
</pre>
 
</pre>
  

Revision as of 19:01, 2 April 2016

Install From Image, with 'minimal install' option

Post install configuration

Remove Network Manager software

# /bin/systemctl disable NetworkManager
# /bin/systemctl disable NetworkManager-dispatcher
# yum erase NetworkManager-tui NetworkManager-glib NetworkManager

Configure Network

Run the commands below to set up a static ip address (192.168.1.221) and hostname (test-centos-1).

# export remote_hostname=guest1
# export remote_ip=192.168.1.221
# export remote_gateway=192.168.1.1

# hostnamectl set-hostname $remote_hostname

# sed -i.bak "s/.*BOOTPROTO=.*/BOOTPROTO=none/g" /etc/sysconfig/network-scripts/ifcfg-eth0

# cat << EOF >> /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR0=$remote_ip
PREFIX0=24
GATEWAY0=$remote_gateway
DNS1="216.136.95.2"
DNS2="64.132.94.250"
NM_CONTROLLED="no"
EOF

# systemctl restart network
# systemctl enable network.service
# systemctl enable sshd
# systemctl start sshd

# echo "checking connectivity"
# ping www.google.com

Disable selinux

# setenforce 0
# sed -i.bak "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config

Remove Postfix, and add needed packages.

# yum -y erase postfix
# yum -y install finger nc net-snmp net-snmp-perl net-snmp-utils ntp perl-Date-Manip \
    perl-DBD-SQLite sendmail sendmail-cf sssd tcp_wrappers tcpdump telnet tftp \
    tog-pegasus traceroute vim-enhanced wget oddjob-mkhomedir net-tools

Fix Time Zone

# rm -f /etc/localtime
# ln -s /usr/share/zoneinfo/MST7MDT /etc/localtime

Turn off rp_filter

# echo "net.ipv4.conf.default.rp_filter = 0" > /etc/sysctl.d/rpfilter.conf