vps交流

[经验] 网络重装 Linux/Windows 系统


本帖最后由 zxxx 于 2022-8-15 12:46 编辑

========================================================
网络重装 netboot.xyz – 需要 VNC 连接
========================================================
https://netboot.xyz/

https://netboot.xyz/docs/category/booting-methods

Booting from USB
How to create a USB stick capable of booting into netboot.xyz
https://netboot.xyz/docs/booting/usb

Booting with an ISO
How to use an ISO to boot into netboot.xyz
https://netboot.xyz/docs/booting/iso

Boot using iPXE
Details how to chainload into netboot.xyz from iPXE
https://netboot.xyz/docs/booting/ipxe

Booting from QEMU
Methods of booting into netboot.xyz using QEMU
https://netboot.xyz/docs/booting/qemu

Booting from TFTP
Methods of booting into netboot.xyz using TFTP and DHCP
https://netboot.xyz/docs/booting/tftp

Boot using VMware
Using netboot.xyz in VMware to install a VM
https://netboot.xyz/docs/booting/vmware

Booting from GRUB
How to use GRUB to boot into netboot.xyz
https://netboot.xyz/docs/booting/grub

On Debian/Ubuntu

  1. # Install grub-imageboot
  2. apt install grub-imageboot
  3. # Download netboot.xyz ISO
  4. mkdir /boot/images
  5. cd /boot/images
  6. wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso
  7. # Update GRUB menu to include this ISO
  8. update-grub2
  9. reboot

复制代码

After reboot, select "Bootable ISO Image: netboot.xyz" in the GRUB menu.

If the GRUB menu disappears too quickly, you may need to edit
/etc/default/grub and increase the GRUB_TIMEOUT.

Run update-grub2 any time you modify this file.

========================================================
萌咖一键网络重装 – MoeClub
========================================================
支持重装Windows

作者:https://moeclub.org/

网页 https://github.com/MoeClub/Note/blob/master/InstallNET.sh

脚本 https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh
Latest commit 4c75424 on 22 Apr [2022]

脚本 https://moeclub.org/attachment/LinuxShell/InstallNET.sh

## License: GPL
## It can reinstall Debian, Ubuntu, CentOS system with network.
## Default root password: MoeClub.org
## Blog: https://moeclub.org
## Written By MoeClub.org

特别注意 OpenVZ 构架不适用

全自动安装默认root密码: MoeClub.org,安装完成后请立即更改密码。

安装Debian11

  1. bash <(wget –no-check-certificate -qO- ‘https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh’) -d 11 -v 64 -a

复制代码

(甲骨文机器需要后加 -firmware 额外的驱动支持)

  1. bash <(wget –no-check-certificate -qO- ‘https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh’) -d 11 -v 64 -a -firmware

复制代码

========================================================
萌咖大佬的一键DD脚本 – veip007
========================================================
支持重装Windows

https://github.com/veip007/dd

全自动安装默认root密码: MoeClub.org,安装完成后请立即更改密码。

能够全自动重装Debian/Ubuntu/CentOS等系统.

同时提供dd安装镜像功能,例如: 全自动无救援dd安装windows系统

全自动安装CentOS时默认提供VNC功能,可使用VNC Viewer查看进度,

VNC端口为 1 或者 5901 ,可自行尝试连接.(成功后VNC功能会消失.)

目前CentOS系统只支持任意版本重装为 CentOS 6.x 及以下版本.

特别注意:OpenVZ构架不适用.

这是一个一键网络重装脚本集合,集合了Linux和WIN包,

Linux:centos6-7; Ubuntu 14 16 18;Debian 7 8 9 10;

WIN:集合了”萌咖大佬、老司机、MeowLove ”的系统,包含win7 2003 2006 2012 2008 2016 2019等系统,当然也可以自定义。

傻瓜式一键脚本

##镜像文件在OneDrive

  1. wget -N –no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/dd-od.sh && chmod +x dd-od.sh && ./dd-od.sh

复制代码

##镜像文件在GoogleDrive

  1. wget -N –no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/dd-gd.sh && chmod +x dd-gd.sh && ./dd-gd.sh

复制代码

DD debian 10示例:

wget -N –no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/InstallNET.sh && chmod +x InstallNET.sh && ./InstallNET.sh -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

一些提示:
特别注意:

萌咖提供的dd安装镜像

远程登陆账号为: Administrator

远程登陆密码为: Vicer

仅修改了主机名,可放心使用.(建议自己制作.)

在dd安装系统镜像时:

在你的机器上全新安装,如果你有VNC,可以看到全部过程.

在dd安装镜像的过程中,不会走进度条(进度条一直显示为0%).完成后将会自动重启.

分区界面标题一般显示为: “Starting up the partitioner“

使用谷歌网盘中储存的镜像: [无限制大小] 获取谷歌网盘文件临时直接下载链接

在全自动安装CentOS时:

如果看到 “Starting graphical installation” 或者类似表达,则表示正在安装.

正常情况下只需要耐心等待安装完成即可.

如果需要查看进度,使用VNC Viewer(或者其他VNC连接工具)

连接提示中的IP地址:端口进行连接.(端口一般为1或者5901)

========================================================
一键网络重装系统 – 魔改版 – cxthhhhh
========================================================
支持重装Windows

https://github.com/MeowLove/Network-Reinstall-System-Modify

https://raw.githubusercontent.com/MeowLove/Network-Reinstall-System-Modify/master/Network-Reinstall-System-Modify.sh

一键网络重装系统 – 魔改版(Network-Reinstall-System-Modify)可以通过互联网重新安装Linux和Windows以及常用操作系统。

例如:CentOS、Debian、Ubuntu、Windows 2012R2、Windows Server 2019、Proxmox-VE、OpenWRT等常见系统,

还可以通过极客功能裸机系统部署平台挂载网络【ISO镜像】远程安装任何系统。

一键网络重装系统 – 魔改版(Network-Reinstall-System-Modify),从MoeClub Vicer分支,

魔改版增加新功能修复Bug后,由CXT – Enjoy Life | 自天佑之,吉无不利提供维护和支持。(更多功能陆续更新中)

问:系统安装的默认密码?
答:通常情况下,默认密码为[cxthhhhh.com]。为了防止暴力破解造成安全隐患,您必须在安装后立即更改默认密码,并做好安全防护!

问:官方发布、使用教程、交流社区在哪里?

答:官方发布(Release)https://www.cxthhhhh.com/network-reinstall-system-modify
使用教程(Tutorials)https://www.cxthhhhh.com/
社区交流(Forum)https://bbs.cxthhhhh.com/

========================================================
25合1 全自动一键网络重装脚本(DD脚本)
========================================================
支持重装Windows

安装重装系统的前提组件:
Debian/Ubuntu:

  1. apt-get install -y xz-utils openssl gawk file wget screen && screen -S os

复制代码

  1. apt update -y && apt dist-upgrade -y

复制代码

RedHat/CentOS:

  1. yum install -y xz openssl gawk file glibc-common wget screen && screen -S os

复制代码

  1. yum makecache && yum update -y

复制代码

如果出现异常,请刷新Mirrors缓存或更换镜像源。

DD 命令:

  1. wget –no-check-certificate -O NewReinstall.sh https://git.io/newbetags && chmod a+x NewReinstall.sh && bash NewReinstall.sh

复制代码

如为CN主机(部分主机商已不能使用),可能出现报错或不能下载脚本的问题,可执行以下命令开始安装.

  1. wget –no-check-certificate -O NewReinstall.sh https://cdn.jsdelivr.net/gh/fcurrk/[email protected]/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh

复制代码

经测试在谷歌云原版系统基础上DD会出现自动获取的子网掩码为255.255.255.255,

如出现这种情况需要手工输入改正为正确的如255.255.255.0,否则会安装完成主机可能会离线。

Oracle Cloud(甲骨文云)可选择23-25一键DD,注意基础系统最好选择Ubuntu,如原系统是CentOS可能无法成功。

========================================================
一键DD脚本 – haoduck
========================================================
支持重装Windows

https://github.com/haoduck/dd

全自动安装默认ROOT密码:

  1. haoduck.com

复制代码

支持自定义ROOT密码、SSH端口(Linux)

支持 Debian11/10/9
支持 Ubuntu20.04/18.04/16.04
支持 CentOS8/7/6
支持 Windows7/8,Server2019/2016/2012/2008/2003等

部分Win镜像支持UEFI(甲骨文)有标注

特别注意:OpenVZ构架不适用.

谷歌云GCP使用时需要把掩码手动改为255.255.255.0

部分代码copy自 https://github.com/veip007/dd 以及 https://github.com/hiCasper/Shell 。

主要是添加了自定义ROOT密码和SSH端口,有现成的代码就偷懒了。

  1. curl -sSL -k -o dd.sh https://raw.githubusercontent.com/haoduck/dd/master/dd.sh && chmod +x dd.sh && bash dd.sh

复制代码

  1. curl -sSL -k -o dd.sh https://fastly.jsdelivr.net/gh/haoduck/[email protected]/dd.sh && chmod +x dd.sh && bash dd.sh

复制代码

========================================================
Debian 网络重装脚本 – 支持 SSH 连接
========================================================
Debian Network Reinstall Script

https://github.com/bohanyang/debi

暂不支持 Oracle Linux 作为原系统。创建新机器时请选择 Ubuntu 20.04 或 18.04 系统模板。

下载脚本:

  1. curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh

复制代码

运行脚本:

  1. sudo ./debi.sh –cdn –network-console –ethx –bbr –user root –password <新系统用户密码>

复制代码

–bbr 开启 BBR
–ethx 网卡名称使用传统形式,如 eth0 而不是 ens3
–cloud-kernel 安装占用空间较小的 cloud 内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。

默认时区为 UTC,添加 –timezone Asia/Shanghai 可使用中国时区。

默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 –china 可使用阿里云镜像源。

如果没有报错可以重启:

  1. sudo shutdown -r now

复制代码

约 30 秒后可以尝试 SSH 登录 installer 用户,密码与之前设置的相同。

如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。

安装完成后会自动重启进入新系统。

========================================================
网络重装 Alpine 脚本
========================================================
NetInstallAlpine

https://github.com/52fancy/NetInstallAlpine

系统要求

支持Grub引导的Linux系统
需提前安装Curl和请安装OpenSSH

使用方法

  1. sh <(curl -k ‘https://cdn.jsdelivr.net/gh/52fancy/NetInstallAlpine/alpine.sh’)

复制代码

特别注意 OS<3.16.0

为了避免成功安装alpine无法ssh登录服务器,请执行以下操作

查看磁盘名称(例如:sda)

  1. fdisk -l

复制代码

挂载并允许root登录

  1. mount /dev/sda3 /mnt
  2. sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /mnt/etc/ssh/sshd_config
  3. umount /dev/sda3

复制代码

重启链接即可

  1. reboot

复制代码

[经验]  网络重装 Linux/Windows 系统
脚本很多 要的是精简的包啊 现在精简包 之前没有存
赞(0)
版权声明:本贴采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
帖子名称:《[经验] 网络重装 Linux/Windows 系统》
帖子链接:https://bbs.toot.su/154279.html

相关推荐