使用镜像检测工具检测镜像
更新时间:2019-11-22
在执行完上述各项操作后,将镜像检测工具下载到镜像的操作系统里边并执行检测。
检查项如下:
序号 | 检测项 | 说明 | 备注 |
---|---|---|---|
1 | VirtIO驱动 | 百度云支持KVM虚拟化技术,导入百度云的镜像需要安装KVM virtio驱动 | |
2 | 密码文件权限 | /etc/shadow文件需要有写权限(禁止使用chattr命令修改shadow文件权限) | |
3 | SELinux | 导入百度云平台的镜像,在导入前需将SElinux置为disable | |
4 | 网络配置 | 1.需将网络设置为DHCP动态获取IP模式;2.需清空70-persistent-net.rules文件 | |
5 | SSH server服务 | 1.建议安装openssh-server,并开启sshd服务;2.建议允许root用户登录。 | |
6 | 防火墙 | 导入百度云的镜像,需要关闭防火墙 | |
7 | 文件系统 | 推荐使用/ext2/ext3/ext4文件系统 | 不支持ext4的metadata_csum高级特性 |
8 | root用户 | 保留root用户 | |
9 | 修改密码命令 | 保留passwd/chpasswd命令 | |
10 | 磁盘分区类型 | 百度云BCC默认支持MBR磁盘分区类型 | |
11 | 逻辑卷(LVM2) | 不支持LVM2磁盘类型 | |
12 | cloud-init | 建议安装cloud-init | 用于设置hostname等 |
13 | 磁盘ID | 建议使用磁盘UUID进行/分区的挂载 | |
14 | 磁盘大小 | 百度云服务器最大支持500GB系统盘。建议你的系统分区大小不要超过500G |
下载检查工具到您的系统中,目前仅支持以下几种发行版的Linux:
CentOS:下载
Ubuntu(不支持ubuntu18):下载
Debian:下载
openSUSE:下载
FreeBSD:下载
为检查工具添加可执行权限(以CentOS为例)
# chmod +x check_centos
# ./check_centos
运行结果示例:
-------------------------------------------------------
Distro: centos
Version: 6.3
-------------------------------------------------------
[ check virtio driver ] [ OK ]
[ check /etc/shadow ] [ OK ]
[ check selinux ] [ OK ]
[ check network config ] [ERROR]
[ check sshd service ] [WARING]
[ check firewall ] [ERROR]
[ check file system ] [ OK ]
[ check root ] [ OK ]
[ check passwd command ] [ OK ]
[ check disk partition ] [ERROR]
[ check LVM ] [ OK ]
[ check cloud-init ] [WARING]
[ check disk uuid ] [ERROR]
[ check disk size ] [ERROR]
-------------------------------------------------------
There are 2 warning(s), 5 error(s).
The reslult file is: centos_check_result_20190328221931.txt
Please check result file for the error/warning informations.
-------------------------------------------------------