Skip 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 部署 Debian 13?

VPS主機商提供的映像通常包含額外套件、預設後門帳號或非標準設定

透過 DD (Disk Deployment) 寫入乾淨的官方映像,可獲得一個完全可控的基礎環境

風險警告

DD會完全覆蓋 整顆系統碟,所有資料將消失

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

請確認主機商提供 noVNC 遠端控制台,以便SSH中斷後進行修復

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

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

DD 前置作業:記錄網路資訊

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

此步驟必須在DD之前完成,資料記錄後再繼續

DD安裝後,SSH可能因網路未正確配置而無法連線。提前記錄以下資訊,才能在 noVNC 中快速修復

查詢網路卡名稱

networkctl list

這裡的 eth0 就是對外網路卡名稱 (找到 OPERATIONAL 欄位顯示 routable 的介面)

---------------------------------
查詢IP位址與子網路遮罩
---------------------------------

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


應顯示
inet 172.17.0.163/18 metric 100 brd 172.17.63.255 scope global dynamic eth0


得到所需要的資訊 (子網路遮罩 /18 不可省略)
172.17.0.163/18




------------------------------
查看閘道 Gateway
------------------------------

查看閘道 Gateway
ip route show



應顯示
default via 172.17.63.253 dev eth0 proto dhcp src 172.17.0.163 metric 100



default via 後方的 IP 即為 Gateway


得到所需要的資訊 Gateway
172.17.63.253
 

--------------------------
查看DNS
--------------------------


cat /etc/resolv.conf


得到所需要的DNS資訊
nameserver 100.100.2.136
nameserver 100.100.2.138





--------------------------
查看完整網路卡狀態
--------------------------

查看完整網路卡狀態,再次確認網路卡資訊
networkctl status eth0


將 "得到所需要的資訊" 記下,例如:
----------------------------------------------------
網路卡名稱:eth0

IP位址 與 子網路遮罩:172.17.0.163/18

Gateway (閘道):172.17.63.253

DNS:100.100.2.136
DNS:100.100.2.138
----------------------------------------------------







------------------------
更新系統並安裝工具
------------------------

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 輸入你的自訂密碼


鏡像源 新加坡
bash InstallNET.sh -debian 13 -mirror "http://ftp.sg.debian.org/debian/" -pwd 輸入你的自訂密碼


鏡像源 日本
bash InstallNET.sh -debian 13 -mirror "http://ftp.jp.debian.org/debian/" -pwd 輸入你的自訂密碼








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

請依照指示重開機


重開機
reboot

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

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

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

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


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

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

01x.png

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

02x.png

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

DD完成後,利用noVNC登入並重新配置網路卡

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

無論SSH是否能直接連線,一律建議透過 noVNC 重新配置網路卡

直接使用SSH能連線不代表 DHCP 租約長期穩定;靜態IP設定可避免後續問題

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

透過 noVNC 登入

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

帳號:root

密碼:DD時你設定的自訂密碼

DD完成後,利用noVNC登入並重新配置網路卡

Edited by Jack

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Account

Navigation

Search

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.