Jump to content
View in the app

A better way to browse. Learn more.

PHP论坛人

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

透過DD方式重新安裝Debian 13 (適用VPS/雲主機)

Featured Replies

----------------

前言與風險警告

----------------

本教學介紹如何使用 DD (Disk Deployment 磁碟部署) 方式,在VPS或雲主機上快速部署全新的Debian 13

警告:

DD安裝會直接將映像檔寫入整顆系統碟,完全覆蓋原有作業系統

僅適用於 VPS/雲主機 環境,不適用於實體主機

不建議在正式營運中的主機直接操作

務必事先備份所有重要資料

請確認主機商提供 noVNC 遠端控制台,以便在SSH無法連線時,進行系統檢查、網路修復或修改防火牆規則

--------------------------------

記下 網路卡名稱 與 IP設定

--------------------------------

在DD前的準備 (非常重要)

請先記下 VPS/雲主機 的 網路卡名稱 與 IP設定

以便DD後,若發現SSH無法連線時,可以重新配置網路卡

SSH登入,找到狀態為 routable 的網路卡名稱

networkctl list

範例:這裡的 ens5 就是網路卡名稱

00-IP.png

IDX LINK TYPE OPERATIONAL SETUP

1 lo loopback carrier unmanaged

2 ens5 ether routable configured


查看指定網路卡的IP (將ens5換成你的網路卡名稱)
ip addr show ens5


查看網路卡狀態 (將ens5換成你的網路卡名稱)
networkctl status ens5


查看DNS設定
cat /etc/resolv.conf



請務必記下以下資訊,例如:

網路卡名稱:ens5

IP位址 與 子網路遮罩:10.2.83.41/16

Gateway (閘道):10.2.255.253

DNS:8.8.8.8

DNS:8.8.4.4




------------------------
開始DD安裝Debian 13
------------------------

SSH登入,更新系統並安裝必要工具

apt update -y


apt install wget -y




------------------
下載DD安裝腳本
------------------

本教學使用 第三方腳本 (非Debian官方):https://github.com/leitbogioro/Tools


下載DD腳本
wget --no-check-certificate https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh


設定執行權限
chmod a+x /root/InstallNET.sh






------------------
執行DD安裝指令
------------------


執行DD安裝指令,建議直接加參數,指定安裝debian 13、mirror鏡像源就近選擇 香港 (或者你的VPS所在地)、自訂root密碼

bash InstallNET.sh -debian 13 -mirror "http://ftp.hk.debian.org/debian/" -pwd 輸入你的自訂密碼


當畫面出現以下訊息時:[Finish] Input 'reboot' to continue the subsequential installation.

請依照指示重啟

reboot

------------------
DD安裝過程說明
------------------

重啟後,SSH會斷線,這是正常現象

請立即透過noVNC遠端控制台登入

系統將自動進行解壓與安裝 (約 10~30 分鐘)

如圖所示,主機商提供的noVNC遠端控制台

01x.png

如圖所示,在noVNC控制台 ,可看見DD過程,系統將自動進行解壓與安裝 (約 10~30 分鐘)

02x.png

DD完成後系統會再次重啟,並顯示登入畫面

---------------

SSH登入

---------------

再次透過SSH連線並登入,帳號為 root,密碼為剛才DD時你的自訂密碼

---------------

SSH無法連線

---------------

若SSH無法連線,最常見的原因是網路未正確配置,請透過noVNC登入並手動配置網路

接下來在noVNC遠端控制台重新配置網路卡

Edited by Jack

Create an account or sign in to comment

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.