Base CentOS Installer Script, adds user accounts, password, utilities, and updates
most of the time when you bring up a CentOS Linux server it’s a standalone system, and there are various tasks that need to be performed that can get quite tedious, especially if there are multiple systems to provision at a time, i hope this script helps!
#!/bin/bash
#############################################################
# Script Created By Andrew Zwieg 5/25/2012 #
# Script for CentOS 6 Linux Servers 5/25/2012 #
#############################################################
###########################
# Stops Iptables Firewall #
###########################
service iptables stop
#################################
# Turns off Iptables at Startup #
#################################
chkconfig iptables off
###############################
# creates local user accounts #
###############################
useradd admin1
useradd admin2
useradd admin3
useradd admin4
###########################
# adds passwords to users #
###########################
echo !P@ssw0rd2 | passwd admin1 –stdin
echo !P@ssw0rd2 | passwd admin2 –stdin
echo !P@ssw0rd3 | passwd admin3–stdin
echo !P@ssw0rd4 | passwd admin4 –stdin
###################################################
# Change Password at login for local accounts #
###################################################
chage -d 0 admin1
chage -d 0 admin2
chage -d 0 admin3
chage -d 0 admin4
##################################
#adds local users to wheel group #
##################################
usermod -a -G wheel admin1
usermod -a -G wheel admin2
usermod -a -G wheel admin3
usermod -a -G wheel admin4
#####################################################################
# This part Installs the Necessary applications for a CentOS Server #
#####################################################################
yum -y install wget
yum -y install rsync
yum -y install finger
yum -y install system-config-firewall
#########################################################
# This part Updates the System with the Latest Updates, and reboots server #
#########################################################
yum -y update
reboot
# End Of Script
exit
That’s IT!
if this was helpful to you, please make a donation to keep this blog running to use for future reference
