之前搞了一台日本Oracle VPS预装的CentOS,一直空在那里没用来做什么。今天闲来无事,考虑试试DD重新安装CentOS试试。结果可行。代码不是很理想,本以为是自动安装,发现要手动。SSH输入后断开,过一段时间用vnc连接

yum -y install wget vim lsof net-tools
cat << EOF >/boot/Reinstall.sh
#!/bin/bash
rm -rf /boot/initrd77.img /boot/vmlinuz77
wget -P /boot/ http://vault.centos.org/7.0.1406/os/x86_64/images/pxeboot/initrd.img -O /boot/initrd77.img
wget -P /boot/ http://vault.centos.org/7.0.1406/os/x86_64/images/pxeboot/vmlinuz -O /boot/vmlinuz77
cat << EOFEOF>/etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 \\\$0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "VNCInstallCentos7" {
    set root='(hd0,gpt3)'
    linuxefi /boot/vmlinuz77 inst.vnc inst.vncpassword=12345678 inst.headless ip=dhcp nameserver=114.114.114.114 inst.repo=http://vault.centos.org/7.0.1406/os/x86_64/ inst.lang=en_US inst.keymap=us
    initrdefi /boot/initrd77.img
}
EOFEOF
#sed -i 's/GRUB_DEFAULT=saved/g' /etc/default/grub
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
grub2-reboot VNCInstallCentos7
reboot
EOF
bash /boot/Reinstall.sh

11/23 重装感觉不是很理想,只能最小安装,被我搞挂了两次。今天无意中发现了另一个脚本,来自https://www.cxthhhhh.com/network-reinstall-system-modify
1、root用户下载脚本

wget --no-check-certificate -qO ~/Network-Reinstall-System-Modify.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/Network-Reinstall-System-Modify.sh' && chmod a+x ~/Network-Reinstall-System-Modify.sh

2、这个脚本有界面选择系统,推荐使用,也可以直接用快捷命令安装
2.1 UI界面

bash ~/Network-Reinstall-System-Modify.sh -UI_Options

2.2 快速安装

bash ~/Network-Reinstall-System-Modify.sh "-version"

把上面的"-version"修改成要DD的版本,比如-CentOS_8。这个脚本对应的系统比较多,除非你对他的版本命名比较清楚,否则建议使用UI界面
安装时间大概15~60分钟不定,安装完成即可通过IP:22(Linux SSH)/IP:3389(Windows RDP)进行连接。

安装完的默认用户:

通常,使用自带镜像,或者您的镜像作者未明确说明系统的用户名和密码的情况下。这个密码务必要立刻修改,因为作者公开的原因,这个密码已经被很多人收录。

对于Microsoft Windows。
默认的用户名是:Administrator
默认的密码是:cxthhhhh.com

对于Linux(CentOS / Debian / Ubuntu),裸机系统部署平台等。
默认的用户名是:root
默认的密码是:cxthhhhh.com

大家可以改密码

passwd

评论已关闭