zoukankan      html  css  js  c++  java
  • Centos虚拟机克隆模板

    Centos6模板

    IPTABLES/SELINUX

    # iptalbes -F

    # service iptables save

    # /etc/init.d/iptables stop

    # chkconfig iptables off

    # setenforce 0

    # getenforce

    NETWORK

    保证网卡都是eth0 :

    #/etc/init.d/NetworkManager stop

    #chkconfig NetworkManager off

    # >/etc/udev/rules.d/70-persistent-net.rules

    #vim /etc/sysconfig/network-scripts/ifcfg-eth0 (删除mac,uuid)

    #vim /etc/sysconfig/network-scripts/ifcfg-eth1 (删除mac,uuid)

    DEVICE=eth0

    TYPE=Ethernet

    ONBOOT=yes

    BOOTPROTO=dhcp

    #/etc/init.d/network restart

    配置YUM

    时间同步

    #yum install chrony -y

    #systemctl start chronyd

    #systemctl enable chronyd

    #vim /etc/chrony.conf

    server 192.168.2.148 iburst

    allow 192.168/16

    # chronyc sources

    SSH连接

    优化SSH连接速度

    注:重启生效

    # vim /etc/ssh/sshd_config

    UseDNS no

    GSSAPIAuthentication no

    密钥认证

    #ssh-keygen -t rsa

    #ssh-copy-id -i 192.168.10.6

    Centos7模板

    # cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

    DEVICE=eth0

    TYPE=Ethernet

    ONBOOT=yes

    BOOTPROTO=dhcp

    #mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0

    #tail -3 /etc/default/grub #红色是添加内容

    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quietnet.ifnames=0 biosdevname=0"

    GRUB_DISABLE_RECOVERY="true

    #grub2-mkconfig -o /boot/grub2/grub.cfg

    #reboot

    当克隆机出现网络问题时,处理方式如下:

    • 编辑相关网卡配置文件,删除其中的"身份证"-->UUID
    • # rm -rf /etc/udev/rules.d/70-persistent-ipoib.rules

    ##########################

    挂载光盘

    # mount -t iso9660 -o loop /dev/cdrom /mnt/

  • 相关阅读:
    搞定Mac Maven
    《数学之美》读书笔记
    Scalable Web Architecture and Distributed Systems
    【程序员】修炼之书
    用平常心,做非常事(字节跳动九周年张一鸣演讲)
    动态规划题目总结
    Spring Boot 启动时,让方法自动执行的 4 种方法!
    MybatisGenerator生成mapper、dao、entity
    HTTPS的GET、POST、PUT、DELETE请求
    SpringBoot使用Slf4j进行日志配置
  • 原文地址:https://www.cnblogs.com/kazihuo/p/8041463.html
Copyright © 2011-2022 走看看