#!/bin/bash
s=`nmcli d | grep "已断开" | awk '{print $1}'`
echo /etc/sysconfig/network-scripts/ifcfg-$s
sed -i "s/^ONBOOT=.*$/ONBOOT=yes/" /etc/sysconfig/network-scripts/ifcfg-$s
cat /etc/sysconfig/network-scripts/ifcfg-$s
systemctl restart NetworkManager sed -ri 's/^.*(UseDNS) .*$/\1 no/' /etc/ssh/sshd_config && sed -rn '/UseDNS/p' /etc/ssh/sshd_config
sed -ri 's/^.*(GSSAPIAuthentication ).*$/\1no/' /etc/ssh/sshd_config && sed -rn '/GSSAPIAuthentication/p' /etc/ssh/sshd_config
setenforce 0
sed -ri.bak 's/^(SELINUX=).*$/\1disabled/' /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
sleep 10
yum clean all
yum makecache
yum install ukui -y
yum install iptables-services -y
systemctl enable iptables.service iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables -X
service iptables save
iptables-save > /etc/sysconfig/iptables
yum -y install chrony sed -ri "s/^(pool.*)$/#\1/" /etc/chrony.conf
c=`cat /etc/chrony.conf | grep 'aliyun'|wc -l`
echo $c if [[ $c -eq 0 ]];then
cat << EOF >> /etc/chrony.conf
server ntp.aliyun.com iburst
server ntp.tuna.tsinghua.edu.cn iburst
server ntp1.aliyun.com iburst
server ntp2.aliyun.com iburst
server ntp3.aliyun.com iburst
server ntp4.aliyun.com iburst
EOF
systemctl restart chronyd
#开机自启
systemctl enable chronyd
else
echo "时间同步已经配置"
fi
chronyc sources
u=`cat /etc/security/limits.conf | grep 20480`
echo $u
if [[ $u -eq 0 ]];then
cat << EOF >> /etc/security/limits.conf
* soft nproc 20480
* hard nproc 20480
* soft nofile 45536
* hard nofile 45536
* soft memlock unlimited
* hard memlock unlimited
EOF
else
echo "ulimit已经配置"
fi
p=`cat /etc/profile | grep PS1 |wc -l`
echo $p
if [[ $p -eq 0 ]];then
cat << EOF >> /etc/profile
PS1="\[\e[1;32m\][\[\e[0m\]\t \[\e[1;33m\]\u\[\e[36m\]@\h\[\e[1;31m\] \W\[\e[1;32m\]]\[\e[0m\]\\\\$"
EOF
else
echo "PS1已经配置"
fi
systemctl set-default multi-user.target
yum install tree -y
yum -y install bash-completion
yum groups install "Development Tools" -y
yum install yum-utils.noarch -y
yum install lrzsz -y
sed -ri "s/RSYSLOG_TraditionalFileFormat/RSYSLOG_FileFormat/" /etc/rsyslog.conf && systemctl restart rsyslog.service
sed -ri "s/^weekly/monthly/" /etc/logrotate.conf
yum install -y yum-utils device-mapper-persistent-data lvm2 wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release openssh-server socat ipvsadm conntrack ntpdate telnet ipvsadm
reboot

最新文章

  1. XSS之xssprotect(转)
  2. php生成curl命令行
  3. atitit。企业的价值观 员工第一 vs 客户第一.docx
  4. .net转的时间戳用java去解析的代码
  5. Centos6.7 python2.6升级到python2.7
  6. jquery 使用方法&lt;转载&gt;
  7. centos+php+coreseek+sphinx+mysql之二sphinx配置篇
  8. 改写java TreeMap制造方便查询的ip内存库
  9. OCP-1Z0-053-V12.02-501题 【转】
  10. 百度编辑器ueditor简单易用
  11. C# 经典入门12章-System.Collections.Generic命名空间
  12. 浅谈ServletContext
  13. SpringMVC运行原理
  14. MySQL数据库导入或者同步大量数据时数据丢失解决方案
  15. 简单理解laravel框架中的服务容器,服务提供者以及怎样调用服务
  16. zabbix安装和配置
  17. 转:图像处理、显示中的行宽(linesize)、步长(stride)、间距(pitch)
  18. [redis] 与redis cluster有关的学习笔记
  19. idea启动springboot项目 报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
  20. loadrunner11迭代录制注册账号

热门文章

  1. 软件工程日报一——Andriod的安装与配置
  2. KVM虚拟机的认知
  3. Smartbi 日志监控工具
  4. Linux CentOS7 安装 Qt 5.9.2 和 lableImg
  5. C# null和Any()检查的快捷方式
  6. Darknet网络代码
  7. 【python】读写文件
  8. VS编译运行报错:找不到ucrtbased.dll文件
  9. kaola
  10. ubuntu22.04 交叉编译openwrt