站点图标 Linux-技术共享

Linux使用脚本一键 DD(重装) 纯净的Linux 系统

基本所有的VPS商家,都会提供免费的Linux系统供安装,如CentOS、Debian、Ubuntu等。那为什么还要使用一键DD脚本重装/更换系统呢?
商家提供的系统版本有限,可能没有自己需要的版本;
商家提供的系统大多都是改装过的,不纯净,可能存在软件兼容行问题;
商家提供的系统大多带有监控,虽说可以卸载,但是心里总是有疙瘩;
以上几种情况,一键DD脚本就可以为服务器更换一个纯净的系统,帮你解决问题。

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p "自定义root密码" -port "自定义ssh端口"
-d 11 表示dd系统为 Debian 11 如果要更换 Ubuntu系统 把参数 -d 改为 -u 20.04 即表示dd系统为 Ubuntu 20.04


萌咖大佬的一键安装Linux系统
下列脚本支持系统重置为 CentOS 7、CentOS 6、Debian 9、Debian 10、ubuntu 18.10。注意有些脚本需要获取 IP、网关、子网掩码等信息,需要填写正确才行安装成功。注意重装有风险,可能导致无法开机,谨慎操作!
使用脚本前最好先安装如下软件
# CentOS 与 RedHat
yum install -y xz openssl gawk file wget
# Debian 与 Ubuntu
apt-get install -y xz-utils openssl gawk file
1.新增对 Oracle AMD,Oracle ARM全面支持. 可支持从 Ubuntu, Oracle Linux 等系统网络重装.
2.更新 dd 镜像的基础系统版本.
3.移除对外部 wget 的依赖.
4.新增 -port 参数, 可更改默认SSH端口.
5.更新 内置的网络参数计算 逻辑.
6.更新 grub 配置文件定位逻辑, 可支持任意引导grub的系统.


以下系统已通过测试(其他自测):
Debian: 9, 10, 11;
Ubuntu: 18.04, 20.04;
CentOS: 6.10;

以下平台已通过测试这些平台先输入sudo -i 切换身份后使用(其他自测):
Oracle、Do、Azure

示范当然先要安装一些插件: apt -y update && apt -y install xz-utils openssl gawk file wget screen && screen -S os 或者 yum -y update && yum -y install xz openssl gawk file glibc-common wget screen && screen -S os
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

开机改密:
#!/bin/bash
echo root:Vicer |sudo chpasswd root
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
reboot

退出移动版