之前主要用的 萌咖Vicer 的网络重装脚本,相当好用。

现在有大佬依Vicer的脚本,重新制作了新的脚本,支持Linux / Windows系统,支持Centos 7 。

安装必须的应用

本重装脚本仅适用于KVM,不适合OpenVZ。

必装 Debian/Ubuntu:

apt-get update
apt-get install -y xz-utils openssl gawk file

必装 RedHat/CentOS:

yum update -y
yum install -y xz openssl gawk file

新 基于IPFS的DD脚本

2020年8月20日

重磅推出!基于IPFS的去中心化Servers DD脚本!
要感谢cxthhhhh大佬的支持和指导
此脚本也是基于大佬的脚本进行的魔改,实现了去中心化部署的功能
过去的DD脚本总是比较依赖于与中心化服务器的联通性,如果连接不上提供供源的中心服务器,可能导致整个脚本都无法使用。
本脚本实现了去中心化的托管,数据将永久存在于IPFS网络当中,拓展性强,不需要考虑地理位置和网络环境的问题。

话不多说,上脚本:
首先需要一个必要的依赖就是 IPFS 网关(IPFS Gateway,一个用于将IPFS区块转化为内容的Web服务器)
这边先列出几个海外地区可以使用的网关
IPFS.IO网关(https://gateway.ipfs.io
CloudFlare网关(https://cloudflare-ipfs.com
Vsharecloud网关(https://gateway.vsharecloud.org
安装脚本需要依赖网关才可以使用,那么为什么还说这个脚本是可以去中心化运行的呢?
因为,IPFS网关服务已经内置在了IPFS客户端当中,只要在自己手中的机器上进行简单的部署,即可得到一个自己的网关。
具体的部署教程后续再写。

重装系统前环境需求:
当前已安装任意由GRUB or GRUB2引导Linux系统(RedHat/CentOS/Debian/Ubuntu/Etc.)

安装重装系统的前提组件,在文章开头就有

获取脚本:

wget --no-check-certificate <IPFS-Gateway>/ipfs/QmPWgw7nwaDBqcD3u1oMHi44MGYpjpVyGkFXS47Tc4g9AJ/Network-Reinstall-System-Modify.sh && chmod a+x Network-Reinstall-System-Modify.sh

脚本用法:

# DD脚本内置镜像:
bash Network-Reinstall-System-Modify.sh <内置镜像选项> <IPFS-Gateway>
# 举例
bash Network-Reinstall-System-Modify.sh -CentOS_7 https://cloudflare-ipfs.com

内置镜像可选:

CentOS 7     -CentOS_7
CentOS 6     -CentOS_6
Debian 9      -Debian_9
Debian 8      -Debian_8
Debian 7      -Debian_7
Ubuntu 18.04      -Ubuntu_18.04
Ubuntu 16.04      -Ubuntu_16.04
Ubuntu 14.04      -Ubuntu_14.04
Windows Server 2019      -Windows_Server_2019
Windows Server 2016      -Windows_Server_2016
Windows Server 2012 R2      -Windows_Server_2012R2
Windows Server 2008 R2      -Windows_Server_2008R2
Windows 7      -Windows_7_Vienna
Windows10     -Windows_10
说明 参数
CentOS 7 -CentOS_7
CentOS 6 -CentOS_6
Debian 9 -Debian_9
Debian 8 -Debian_8
Debian 7 -Debian_7
Ubuntu 18.04 -Ubuntu_18.04
Ubuntu 16.04 -Ubuntu_16.04
Ubuntu 14.04 -Ubuntu_14.04
Windows Server 2019 -Windows_Server_2019
Windows Server 2016 -Windows_Server_2016
Windows Server 2012 R2 -Windows_Server_2012R2
Windows Server 2008 R2 -Windows_Server_2008R2
Windows 7 -Windows_7_Vienna
Windows10 -Windows_10
内置镜像选项
海外地区 IPFS.IO网关 https://gateway.ipfs.io
海外地区 CloudFlare网关 https://cloudflare-ipfs.com
海外地区 Vsharecloud网关 https://gateway.vsharecloud.org
网关选项

安装Windows系统时,你需要购买来自Microsoft或其合作伙伴正版系统授权并激活系统使用。继续安装即代表您知悉并已经购买正版授权。
内置镜像密码:cxthhhhh.com

DD自己手中的其他镜像:
bash Network-Reinstall-System-Modify.sh -DD "%URL%"

所有的内置镜像以及依赖源已经托管在VshareCloud的IPFS内容库当中
只要使用的人越多,镜像的加载速度就会越快。
鼓励大家积极使用,有条件的最好可以自建IPFS网关使用。

老下载脚本1(root用户)

源码安全,并托管在Github

原版有些不稳定.镜像转载自 https://www.815494.com/html/734.html

# 别人备份的镜像
wget http://shell.p1e.cn/reinstall/dd.sh  && chmod +x dd.sh && ./dd.sh

# 原版地址
wget --no-check-certificate -qO ~/Network-Reinstall-System-Modify.sh 'https://www.cxthhhhh.com/tech-tools/Network-Reinstall-System-Modify/Network-Reinstall-System-Modify.sh' && chmod a+x ~/Network-Reinstall-System-Modify.sh

所有系统安装完毕的默认密码是 cxthhhhh.com ,为了防止暴力破解,你必须在安装完毕立刻修改默认密码!
用户名linux是root,windows是administrator

安装Linux系统

①. 一键网络重装纯净CentOS 7(推荐)

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

②. 一键网络重装纯净CentOS 6

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

③. 一键网络重装纯净Debian 9(推荐)

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

④. 一键网络重装纯净Debian 8

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

⑤. 一键网络重装纯净Debian 7

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

⑥. 一键网络重装纯净Ubuntu 18.04(推荐)

bash ~/Network-Reinstall-System-Modify.sh -Ubuntu_18.04

⑦. 一键网络重装纯净Ubuntu 16.04

bash ~/Network-Reinstall-System-Modify.sh -Ubuntu_16.04

⑧. 一键网络重装纯净Ubuntu 14.04

bash ~/Network-Reinstall-System-Modify.sh -Ubuntu_14.04

安装Windows系统

①. 一键网络重装纯净Windows Server 2019(推荐)

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

②. 一键网络重装纯净Windows Server 2016

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

③. 一键网络重装纯净Windows Server 2012 R2

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

④. 一键网络重装纯净Windows Server 2008 R2

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

⑤. 一键网络重装纯净Windows 7 Vienna

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

⑥. 一键网络重装纯净Windows Server 2003

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

安装裸机系统部署平台

bash ~/Network-Reinstall-System-Modify.sh -CXT_Bare-metal_System_Deployment_Platform

*仅适用于高端用户,手动安装任意系统。可通过网络ISO或iPXE安装任意系统。(使用教程)

DD自己的系统

# %ULR% 替换为您自己的映像地址
bash ~/Network-Reinstall-System-Modify.sh -DD "%URL%"

下载脚本2(root用户)

# 原版地址
wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh

#默认登录密码:
CentOS:Pwd@CentOS
#其他 Linux 系统:Pwd@Linux
Windows Server 2019 Datacenter x64(密码:Password147)
Windows Server 2016 Datacenter x64(密码:Password147)
Windows Server 2012 R2 Datacenter x64(密码:Password147)

支持重装的系统

  • Ubuntu 18.04/16.04
  • Debian 9/10
  • CentOS 6
  • CentOS 7 (DD方式)
  • 自定义DD镜像

特性 / 优化

  • 自动获取IP地址、网关、子网掩码
  • 自动判断网络环境,选择国内/外镜像,解决速度慢的问题
  • 懒人一键化,无需复杂的命令
  • 解决萌咖脚本中一些导致安装错误的问题
  • CentOS 7 镜像抛弃LVM,回归ext4,减少不稳定因素

注意

  • 重装后系统密码均在脚本中有提供,安装后请尽快修改密码,Linux系统建议启用密钥登陆。
  • OpenVZ / LXC 架构系统不适用

DD Win10

来源转载自 https://moeclub.org/2018/12/03/714/?spm=46.5

# DHCP(能自动获取网络参数)
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -dd "https://image.moeclub.org/GoogleDrive/1OVA3t-ZI2arkM4E4gKvofcBN9aoVdneh"

# 非DHCP(不能自动获取网络参数)
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -dd "https://image.moeclub.org/GoogleDrive/1OVA3t-ZI2arkM4E4gKvofcBN9aoVdneh" --ip-addr xx.xx.xx.xx --ip-gate xx.xx.xx.xx --ip-mask xx.xx.xx.xx

# 大陆(添加mirror参数,在一些过程上可以提速)
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -dd "https://image.moeclub.org/GoogleDrive/1OVA3t-ZI2arkM4E4gKvofcBN9aoVdneh" --mirror 'http://mirrors.ustc.edu.cn/debian/'
#例如大陆+非DHCP
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -dd "https://image.moeclub.org/GoogleDrive/1OVA3t-ZI2arkM4E4gKvofcBN9aoVdneh"  --ip-addr 10.154.36.122 --ip-gate 10.154.0.1 --ip-mask 255.255.192.0

Linux源 & WIN 激活

KMS 激活方案

2017-1-1 0

开启root登陆权限

2019-2-7 0

其他提示

腾讯云中国版部分机器(腾讯云国际版机器测试没问题)和 DigitalOcean机器请注意,如果安装完无法联网(SSH无法连接)。你应该进入VNC,修改网络配置,设置静态IP。(因为他们的服务商推送了错误的DHCP网关信息,所以自动获取的网络是无效的,无法访问网络。)

vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO="static" #dhcp改为static
IPADDR=192.168.1.100 #静态IP
GATEWAY=192.168.1.255 #默认网关
NETMASK=255.255.255.0 #子网掩码
# 参考脚本-腾讯云上海
cat > /etc/sysconfig/network-scripts/ifcfg-eth0<<-EOF
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
GATEWAY=10.154.0.1
HWADDR=52:54:00:1e:40:5f
IPADDR=10.154.36.122
NETMASK=255.255.192.0
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
EOF
systemctl restart network
#上海WIN IP 仅供参考
10.154.36.122
255.255.192.0
10.154.0.1
10.236.158.114
10.236.158.106
# Centos6的网卡重启方法:
service network restart
# Centos7的网卡重启方法:
systemctl restart network

载入内存安装-教程自行百度

grub-imageboot

文章原作者

cxthhhhh.com

blog.hicasper.com