页首自改代码

Hey, Nice to meet You.  why ?

☆☆☆所谓豪杰之士,必有过人之节.人情有所不能忍者,匹夫见辱,拔剑而起,挺身而斗,此不足为勇也,天下有大勇者,猝然临之而不惊,无故加之而不怒.此其所挟持者甚大,而其志甚远也.          
返回顶部

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/

posted on 2017-12-15 09:47  罗穆瑞  阅读(160)  评论(0编辑  收藏  举报

导航