云主机模板制作

################################
centos 6.5

yum 换成ali

主机名改成centos6

yum install qemu-guest-agent

删除网卡mac

清除网卡信息

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

远程端口修改为2000

sed -i 's/#Port 22/Port 2000/g' /etc/ssh/sshd_config
service sshd restart

禁用selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0

添加防火墙允许

清除日志
echo > /var/log/wtmp
echo > /var/log/btmp
history -c

################################
2008 R2
远程端口修改为1234
封139和445
升级补丁
打开ping

2008-v2.img.qcow2
Win-2008-r2-v2

安装guset-agent
清除日志
修改默认密码为

################################
2008 R2 加 mssql 2008

2008-ms-v2.img.qcow2
Win-2008-r2-sql-08-v2

安装guset-agent
清除日志
修改默认密码为

################################
2008 R2 系统盘100g

远程端口修改为1234
封139和445
升级补丁
打开ping
安装guset-agent
清除日志
修改默认密码

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

################################
2012 R2 系统盘100g

远程端口修改为
封139和445
升级补丁
打开ping
安装guset-agent
清除日志
修改默认密码为

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

################################
centos 7
主机名改成centos7
hostnamectl set-hostname centos7

yum 换成163

yum install qemu-guest-agent

删除网卡mac

清除网卡信息

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

远程端口修改为2000
sed -i 's/#Port 22/Port 2000/g' /etc/ssh/sshd_config
service sshd restart

禁用selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0

清除日志
echo > /var/log/wtmp
echo > /var/log/btmp
history -c

添加防火墙允许
firewall-cmd --zone=public --add-port=2000/tcp --permanent
firewall-cmd --reload

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

Centos yum源
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存

猜你喜欢

转载自blog.51cto.com/46231571/2132428