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
    

      

      

  • 相关阅读:
    leetcode-15 三数之和
    leetcode-113 路径之和
    leetcode-112 路径之和
    leetcode-1 两数之和
    leetcode-215 第k大元素
    leetcode 698 集合k划分
    编程之法之字符串
    LeetCode 830. Positions of Large Groups
    LeetCode 821. Shortest Distance to a Character
    LeetCode 213. House Robber II
  • 原文地址:https://www.cnblogs.com/reid21/p/10630212.html
Copyright © 2011-2022 走看看