zoukankan      html  css  js  c++  java
  • 系统初始化

    一般系统安装好后,按照自己习惯定义

    #alias
    echo "alias cdyum='cd /etc/yum.repos.d/'" >> /root/.bashrc 
    echo "alias cdnet='cd /etc/sysconfig/network-scripts/'" >> /root/.bashrc 
    source /root/.bashrc
    
    
    #set hosts
    #interFace=·ifconfig | awk -F: 'NR==1{print $1}'·
    #ipAddress=`ip add show $interFace |grep 'inet '|awk -F'[ /]+' '{print $3}'`
    ipAddress=`hostname -I`
    hostName=`hostname`
    echo "$ipAddress   $hostName" >> /etc/hosts
    tail -1 /etc/hosts
    
    
    #ssh dns
    grep UseDNS /etc/ssh/sshd_config
    sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
    sed -i 's/#UseDNS no/UseDNS no/' /etc/ssh/sshd_config
    grep UseDNS /etc/ssh/sshd_config
    
    
    #firewall
    iptables -F
    iptables -L -n
    systemctl stop firewalld
    systemctl disable firewalld
    
    
    #selinux
    [ `getenforce` != "Disabled" ] && setenforce 0 &> /dev/null && sed -i s/"^SELINUX=.*$"/"SELINUX=disabled"/g /etc/selinux/config
    getenforce
    grep SELINUX= /etc/selinux/config
    
    
    #set yum repo
    cat << EOF > /etc/yum.repos.d/rhel.repo
    [rhel] 
    name=rhel
    baseurl=file:///mnt
    enabled=1
    gpgcheck=0
    EOF
    mount /dev/cdrom /mnt
    yum clean all
    yum install vsftpd createrepo bash-completion vim net-tools  lrzsz -y
    systemctl start vsftpd;systemctl enable vsftpd
    

      

      

  • 相关阅读:
    JAVA网络编程入门
    悲观锁和乐观锁
    原子性---Atomic
    volatile关键字
    leetcode_111. 二叉树的最小深度
    leetcode_110. 平衡二叉树
    leetcode_108. 将有序数组转换为二叉搜索树
    leetcode_107. 二叉树的层次遍历 II
    leetcode_104. 二叉树的最大深度
    leetcode_101. 对称二叉树
  • 原文地址:https://www.cnblogs.com/reid21/p/10630212.html
Copyright © 2011-2022 走看看