标签:route 链接 不能 软件 selinux dos 同步 backup bucket
\cp /etc/hosts{,.bak}
cat >/etc/hosts<<EOF
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5 lb01
172.16.1.6 lb02
172.16.1.7 web01
172.16.1.8 web02
172.16.1.9 web03
172.16.1.51 db01
172.16.1.31 nfs01
172.16.1.41 backup
172.16.1.61 m01
EOF
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
sed -i.bak ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
grep SELINUX=disabled /etc/selinux/config
setenforce 0
getenforce
/etc/init.d/iptables stop
chkconfig iptables off
export LANG=en
chkconfig|egrep -v "crond|sshd|network|rsyslog|sysstat"|awk ‘{print "chkconfig",$1,"off"}‘|bash
chkconfig --list|grep 3:on
useradd 用户名
echo 密码|passwd --stdin 用户名
\cp /etc/sudoers /etc/sudoers.ori
echo "oldboy ALL=(ALL) NOPASSWD: ALL " >>/etc/sudoers
tail -1 /etc/sudoers
visudo -c
cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori
echo ‘LANG="en_US.UTF-8"‘ >/etc/sysconfig/i18n
source /etc/sysconfig/i18n
echo $LANG
echo ‘#time sync by lidao at 2017-03-08‘ >>/var/spool/cron/root
echo ‘*/5 * * * * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1‘ >>/var/spool/cron/root
crontab -l
echo ‘* - nofile 65535 ‘ >>/etc/security/limits.conf
tail -1 /etc/security/limits.conf
cat >>/etc/sysctl.conf<<EOF
net.ipv4.tcp_fin_timeout = 2
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_keepalive_time = 600
net.ipv4.ip_local_port_range = 4000 65000
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.core.somaxconn = 16384
net.core.netdev_max_backlog = 16384
net.ipv4.tcp_max_orphans = 16384
#以下参数是对iptables防火墙的优化,防火墙不开会提示,可以忽略不理。
net.nf_conntrack_max = 25000000
net.netfilter.nf_conntrack_max = 25000000
net.netfilter.nf_conntrack_tcp_timeout_established = 180
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120
EOF
sysctl -p
yum install lrzsz nmap tree dos2unix nc telnet sl -y
sed -i.bak ‘s@#UseDNS yes@UseDNS no@g;s@^GSSAPIAuthentication yes@GSSAPIAuthentication no@g‘ /etc/ssh/sshd_config
/etc/init.d/sshd reload
两删除:删除网卡(eth0 eth1)中,UUID(硬件标识信息)和HWADDR(网络mac地址)进行删除
sed -ri ‘/UUID|HWADDR/d‘ /etc/sysconfig/network-scripts/ifcfg-eth[01]
清空:清空网络规则配置文件
echo ‘>/etc/udev/rules.d/70-persistent-net.rules‘ >>/etc/rc.local
shutdown -h now
链接克隆:
优势:节省系统资源 克隆效率较高
劣势:模板主机不能出现问题,一旦模板主机失效,所有克隆主机也无法正常工作
完整克隆:
优势:模板主机和克隆主机相互独立,模板主机出现问题,克隆主机依旧可以正常使用
劣势:浪费系统资源 克隆效率较低
# 修改主机名称
hostname backup
sed -i "s#主机名称#backup#g" /etc/sysconfig/network
说明:主机名称需要填写为当前系统主机名,然后进行一下替换即可
# 修改主机IP地址信息
sed -i "s#200#41#g" /etc/sysconfig/network-scripts/ifcfg-eth[01]
cat /etc/sysconfig/network-scripts/ifcfg-eth[01]
# 重启网络服务,重新连接虚拟主机
标签:route 链接 不能 软件 selinux dos 同步 backup bucket
原文地址:https://www.cnblogs.com/yjiu1990/p/10361218.html