From owner-svn-doc-head@freebsd.org Thu Oct 26 15:25:15 2017 Return-Path: Delivered-To: svn-doc-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1083BE4C385; Thu, 26 Oct 2017 15:25:15 +0000 (UTC) (envelope-from rcyu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF7D81ECA; Thu, 26 Oct 2017 15:25:14 +0000 (UTC) (envelope-from rcyu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9QFPDVV017800; Thu, 26 Oct 2017 15:25:13 GMT (envelope-from rcyu@FreeBSD.org) Received: (from rcyu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9QFP97k017797; Thu, 26 Oct 2017 15:25:09 GMT (envelope-from rcyu@FreeBSD.org) Message-Id: <201710261525.v9QFP97k017797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rcyu set sender to rcyu@FreeBSD.org using -f From: Ruey-Cherng Yu Date: Thu, 26 Oct 2017 15:25:09 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r51147 - head/zh_TW.UTF-8/books/handbook X-SVN-Group: doc-head X-SVN-Commit-Author: rcyu X-SVN-Commit-Paths: head/zh_TW.UTF-8/books/handbook X-SVN-Commit-Revision: 51147 X-SVN-Commit-Repository: doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 15:25:15 -0000 Author: rcyu Date: Thu Oct 26 15:25:09 2017 New Revision: 51147 URL: https://svnweb.freebsd.org/changeset/doc/51147 Log: - Update po file with newest handbook document. - Translated following chaptors or sectors: 28.7. Domain Name System (DNS) 28.8. Apache HTTP Server 28.9. File Transfer Protocol (FTP) 28.10. File and Print Services for Microsoft® Windows® Clients (Samba) 28.11. Clock Synchronization with NTP 29.1. Synopsis 29.2. Firewall Concepts Submitted by: cwlin@gmail.com Differential Revision: https://reviews.freebsd.org/D12756 Modified: head/zh_TW.UTF-8/books/handbook/book.xml head/zh_TW.UTF-8/books/handbook/zh_TW.po Modified: head/zh_TW.UTF-8/books/handbook/book.xml ============================================================================== --- head/zh_TW.UTF-8/books/handbook/book.xml Thu Oct 26 00:35:49 2017 (r51146) +++ head/zh_TW.UTF-8/books/handbook/book.xml Thu Oct 26 15:25:09 2017 (r51147) @@ -22,6 +22,7 @@ + @@ -72,6 +73,7 @@ + @@ -101,6 +103,7 @@ + @@ -131,6 +134,7 @@ + @@ -176,6 +180,7 @@ + @@ -270,9 +275,11 @@ + + @@ -288,6 +295,7 @@ + @@ -345,6 +353,7 @@ + @@ -357,6 +366,7 @@ + @@ -406,6 +416,7 @@ + @@ -428,6 +439,7 @@ + @@ -515,6 +527,7 @@ + @@ -544,6 +557,7 @@ + @@ -612,16 +626,25 @@ $FreeBSD$ -->]> - + + + + + + + + + + FreeBSD 使用手冊 FreeBSD 文件計劃 - $FreeBSD$ + $FreeBSD$ - $FreeBSD$ + $FreeBSD$ 1995 @@ -724,9 +747,9 @@ - 歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 11.0-RELEASE, FreeBSD 10.3-RELEASE 以及 FreeBSD 9.3-RELEASE 的安裝與平日操作的說明。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中,因此部份章節可能尚未仍未完成,如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專案郵遞論壇。 + 歡迎使用 FreeBSD! 本使用手冊涵蓋範圍包括了 FreeBSD 11.1-RELEASE, FreeBSD 11.0-RELEASEFreeBSD 10.4-RELEASE 的安裝與平日操作的說明。 這份使用手冊是很多人的集體創作,而且仍然『持續不斷』的進行中,因此部份章節可能尚未仍未完成,如果您有興趣協助本計畫的話,請寄電子郵件至 FreeBSD 文件專案郵遞論壇。 - FreeBSD 網站 可以找到本文件的最新版本,舊版文件可從 http://docs.FreeBSD.org/doc/ 取得。本文件也提供各種格式與不同壓縮方式的版本可自 FreeBSD FTP 伺服器 或是其中一個 鏡像網站 下載。 列印出來的實體書面資料可在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文件的資料。 + FreeBSD 網站 可以找到本文件的最新版本,舊版文件可從 https://docs.FreeBSD.org/doc/ 取得。本文件也提供各種格式與不同壓縮方式的版本可自 FreeBSD FTP 伺服器 或是其中一個 鏡像網站 下載。 列印出來的實體書面資料可在 FreeBSD 商城 購買。 此外,您可在 搜尋頁面 中搜尋本文件或其他文件的資料。 @@ -1346,7 +1369,7 @@ 4.4BSD-Lite - FreeBSD 是一個從 4.4BSD-Lite 衍生出而能在以 Intel (x86 與 Itanium), AMD64, Sun UltraSPARC 為基礎的電腦上執行的作業系統。同時,移植到其他平台的工作也在進行中。 對於本計劃歷史的介紹,請看 FreeBSD 歷史, 對於 FreeBSD 的最新版本介紹,請看 最新的發行版。 若打算對於 FreeBSD 計劃有所貢獻的話 (程式碼、硬體、經費), 請看 如何對 FreeBSD 貢獻。 + FreeBSD 是一個從 4.4BSD-Lite 衍生出而能在以 Intel (x86 與 Itanium), AMD64, ARM, Sun UltraSPARC 為基礎的電腦上執行的作業系統。同時,移植到其他平台的工作也在進行中。 對於本計劃歷史的介紹,請看 FreeBSD 歷史, 對於 FreeBSD 的最新版本介紹,請看 最新的發行版。 若打算對於 FreeBSD 計劃有所貢獻的話 (程式碼、硬體、經費), 請看 如何對 FreeBSD 貢獻。 FreeBSD 能做什麼? @@ -1623,13 +1646,9 @@ - Sandvine - + Sandvine Sandvine - - Sandvine uses FreeBSD as the basis of their - high performance real-time network processing platforms - that make up their intelligent network policy control - products. + - Sandvine 使用 FreeBSD 作為它的高性能即時網路處理平台的基礎來建立它們的智慧網路策略控制產品。 @@ -1732,7 +1751,7 @@ - TrueOS + TrueOS TrueOS - 訂製版本的 FreeBSD,裝備了給桌面使用者使用的圖型化工具來展示 FreeBSD 強大的功能給所有使用者,專門設計來緩解使用者在 Windows 與 OS X 間的過渡。 @@ -2029,7 +2048,7 @@ - 此外,可在下列網址找到最新版 (也是更新最頻繁的版本):http://www.FreeBSD.org/ + 此外,可在下列網址找到最新版 (也是更新最頻繁的版本):https://www.FreeBSD.org/ @@ -2167,7 +2186,7 @@ 桌面電腦與筆記型電腦最常見的處理器類型,運用在近代的系統。Intel 稱該類型為 Intel64,其他製造商則稱該類型為 x86-64 - 與 amd64 相容的處理器包含:AMD Athlon64, AMD Opteron, 多核心 Intel Xeon 以及 Intel Core 2 與之後的處理器。 + 與 amd64 相容的處理器範例包含:AMD Athlon64, AMD Opteron, 多核心 Intel Xeon 以及 Intel Core 2 與之後的處理器。 @@ -2287,9 +2306,9 @@ 檢查 FreeBSD 勘誤表 - 儘管 FreeBSD Project 努力確保每個 FreeBSD 發行版能夠儘可能地穩定,但錯誤偶爾還是會悄悄出現,並有極小的可能會發生影響安裝流程的錯誤,當這些問題被發現並修正後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (http://www.freebsd.org/releases/11.0R/errata.html)。 安裝前先檢查勘誤表,以確保沒有會影響到安裝的問題。 + 儘管 FreeBSD 計劃努力確保每個 FreeBSD 發行版能夠儘可能地穩定,但錯誤偶爾還是會悄悄出現,並有極小的可能會發生影響安裝流程的錯誤,當這些問題被發現並修正後,會被紀錄在 FreeBSD 網站的 FreeBSD 勘誤表 (https://www.freebsd.org/releases/11.1R/errata.html)。 安裝前先檢查勘誤表,以確保沒有會影響到安裝的問題。 - 所有發行版的資訊和勘誤表可以在 FreeBSD 網站的發行資訊找到 (http://www.freebsd.org/releases/index.html)。 + 所有發行版的資訊和勘誤表可以在 FreeBSD 網站的發行資訊找到 (https://www.freebsd.org/releases/index.html)。 @@ -3696,7 +3715,7 @@ Starting sshd. 本節涵蓋基礎的安裝疑難排解,例如一些已有人回報的常見問題。 - 查看該 FreeBSD 版本的 Hardware Notes (http://www.freebsd.org/releases/index.html) 文件來確認是否支援該硬體。若確定有支援該硬體但仍然卡住或發生其他問題,請依照 的指示編譯自訂核心來加入未在 GENERIC 核心的裝置。預設的核心會假設大部份的硬體裝置會使用原廠預設的 IRQs, I/O 位址,及 DMA 通道,若硬體已經被重新設定過,自訂的核心設定檔可以告訴 FreeBSD 到那找到這些裝置。 + 查看該 FreeBSD 版本的 Hardware Notes (https://www.freebsd.org/releases/index.html) 文件來確認是否支援該硬體。若確定有支援該硬體但仍然卡住或發生其他問題,請依照 的指示編譯自訂核心來加入未在 GENERIC 核心的裝置。預設的核心會假設大部份的硬體裝置會使用原廠預設的 IRQs, I/O 位址,及 DMA 通道,若硬體已經被重新設定過,自訂的核心設定檔可以告訴 FreeBSD 到那找到這些裝置。 部份安裝問題可以透過更各種硬體元件的韌體來避免或緩解,特別是主機板。主機板的韌體通常稱為 BIOS,大部份主機板與電腦製造商會有網站可以取得升級程式與升級資訊。 @@ -6102,7 +6121,7 @@ Swap: 2048M Total, 2048M Free - FreeBSD 網站有維護一份可搜尋的最新應用程式清單,在 http://www.FreeBSD.org/ports/。 可以依應用程式名稱或軟體分類來搜尋 Port。 + FreeBSD 網站有維護一份可搜尋的最新應用程式清單,在 https://www.FreeBSD.org/ports/。 可以依應用程式名稱或軟體分類來搜尋 Port。 @@ -6918,18 +6937,18 @@ ports-mgmt/pkg 雖然可以同時使用自訂的檔案庫與官方檔案庫,但有時關閉官方檔案庫會有幫助。這可以透過建立一個設定檔覆蓋並關閉官方的設定檔來完成。建立 /usr/local/etc/pkg/repos/FreeBSD.conf 包含以下內容: - FreeBSD: { + FreeBSD: { enabled: no -} +} 通常最簡單要提供 poudriere 檔案庫給客戶端的方式是透過 HTTP。安裝一個網頁伺服器來提供套件目錄,通常會像:/usr/local/poudriere/data/packages/10amd64,其中 10amd64 是編譯的名稱。 若要連往套件檔案庫的 URL 是:http://pkg.example.com/10amd64,則在 /usr/local/etc/pkg/repos/custom.conf 的檔案庫設定檔為: - custom: { + custom: { url: "http://pkg.example.com/10amd64", enabled: yes, -} +} @@ -7931,7 +7950,7 @@ DisplayManager.requestPort: 0 GNOME GNOME - GNOME 是一個擁有友善使用者介面的的桌面環境,它包括用於啟動應用程式和顯示狀態的面板、一系列工具與應用程序及一套可讓應用程式更容易進行合作、相互一致的協定。更多有關 FreeBSD GNOME 的訊息可在 http://www.FreeBSD.org/gnome 取得,該網站包含了有關在 FreeBSD 安裝、設定和管理 GNOME 的額外文件。 + GNOME 是一個擁有友善使用者介面的的桌面環境,它包括用於啟動應用程式和顯示狀態的面板、一系列工具與應用程序及一套可讓應用程式更容易進行合作、相互一致的協定。更多有關 FreeBSD GNOME 的訊息可在 https://www.FreeBSD.org/gnome 取得,該網站包含了有關在 FreeBSD 安裝、設定和管理 GNOME 的額外文件。 這套桌面環境可以從套件安裝: @@ -8471,7 +8490,7 @@ EndSection web - 在 FreeBSD 中並未預先安裝好網頁瀏覽器。 但在 Port 套件集中的 www 分類中有許多瀏覽器可以採 Binary 套件安裝或自 Port 套件集編譯的方式安裝。 + 在 FreeBSD 中並未預先安裝好網頁瀏覽器。 但在 Port 套件集中的 www 分類中有許多瀏覽器可以採 Binary 套件安裝或自 Port 套件集編譯的方式安裝。 KDEGNOME 桌面環境都有提供自有的 HTML 瀏覽器。請參考 來了解更多有關如何設定完整桌面環境的資訊。 @@ -8560,7 +8579,7 @@ EndSection 編譯 Port 時使用預設設定選項。 - 安裝完成時,啟動 firefox,在網址列輸入 about:plugins 並按 Enter 鍵。 會出現一個頁面列出已安裝的附加元件。 Java 附加元件應該會列在其中。 + 安裝完成後,啟動 firefox,在網址列輸入 about:plugins 並按 Enter 鍵,便會出現一個列出已安裝附加元件的頁面,清單中應該要有 Java 附加元件。 若瀏覽器無法找到附加元件,每位使用者則須執行以下指令並重新執行瀏覽器: @@ -8586,7 +8605,7 @@ EndSection - 自 Port 安裝 www/linux-c6-flashplugin11 ,受到授權條款的限制,該套件無 Binary 版本。 + 自 Port 安裝 www/linux-flashplayer ,受到授權條款的限制,該套件無 Binary 版本。 @@ -8667,7 +8686,7 @@ EndSection # pkg install kwebkitpart - 由 Port 套件集安裝: + 從 Port 套件集安裝: # cd /usr/ports/www/kwebkitpart # make install clean @@ -8841,7 +8860,7 @@ EndSection # cd /usr/ports/graphics/gimp # make install clean - 在 Port 套件集的 graphics 分類 (freebsd.org/ports/graphics.html) 下也包含了許多 GIMP 相關的附加元件,說明檔及使用手冊。 + 在 Port 套件集的 graphics 分類 (freebsd.org/ports/graphics.html) 下也包含了許多 GIMP 相關的附加元件,說明檔及使用手冊。 @@ -8907,7 +8926,7 @@ EndSection # pkg install libreoffice - Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中含有數個 LibreOffice 的語系。安裝在地化套件時,請替換 libreoffice 為在地化套件的名稱。 + Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中含有數個 LibreOffice 的語系。安裝在地化套件時,請替換 libreoffice 為在地化套件的名稱。 套件安裝之後,輸入以下指令來執行 LibreOffice @@ -8921,7 +8940,7 @@ EndSection # make install clean - 要編譯在地化版本,則需 cd 進入想要的語言 Port 目錄。支援的語言可在 Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中找到。 + 要編譯在地化版本,則需 cd 進入想要的語言 Port 目錄。支援的語言可在 Port 套件集的編輯器分類 (freebsd.org/ports/editors.html) 中找到。 @@ -9307,7 +9326,7 @@ EndSection PCI sound cards - 開始設定之前,必須先知道你的音效卡型號、晶片為何。 FreeBSD 支援許多種音效卡,請檢查支援的音效硬體表 Hardware Notes,以確認你的音效卡是否支援以及如何在 FreeBSD 上驅動。 + 開始設定之前,必須先知道你的音效卡型號、晶片為何。 FreeBSD 支援許多種音效卡,請檢查支援的音效硬體表 Hardware Notes,以確認你的音效卡是否支援以及如何在 FreeBSD 上驅動。 kernel @@ -9673,7 +9692,7 @@ pcm7: <HDA Realtek ALC889 PCM #3 Digital> at cad provides an alternative, command-line MP3 player. Once installed, specify the MP3 file to play on the command line. If the system has multiple - audio devices, the sound device can also be specifed: + audio devices, the sound device can also be specified: # mpg123 -a /dev/dsp1.0 Foobar-GreatestHits.mp3 High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 @@ -10473,7 +10492,7 @@ bktr0: Pinnacle/Miro TV, Philips SECAM tuner.# pkg install mythtv - 或由 Port 套件集安裝: + 或從 Port 套件集安裝: # cd /usr/ports/multimedia/mythtv # make install @@ -10908,11 +10927,10 @@ ath0@pci0:3:0:0: class=0x020000 card=0x058a1014 man1 指令加上 旗標可提供有用的資訊,例如,這可列出有包含指定裝置品牌或名稱的手冊頁面清單: - # man -k Atheros + # man -k Atheros +ath(4) - Atheros IEEE 802.11 wireless network driver +ath_hal(4) - Atheros Hardware Access Layer (HAL) - ath(4) - Atheros IEEE 802.11 wireless network driver -ath_hal(4) - Atheros Hardware Access Layer (HAL) - 準備好硬體清單之後,參考該清單來確認已安裝的硬體驅動程式在編輯自訂核心設定時沒有被移除。 @@ -12951,9 +12969,7 @@ lp: 在 FreeBSD 安裝基本的 Linux 程式庫和 Binary 最簡單的方式是安裝 emulators/linux_base-c6 套件或是 Port 。要安裝 Port: - # printf "compat.linux.osrelease=2.6.18\n" >> /etc/sysctl.conf -# sysctl compat.linux.osrelease=2.6.18 -# pkg install emulators/linux_base-c6 + # pkg install emulators/linux_base-c6 要在開機時開啟 Linux 相容性,可以加入這行到 /etc/rc.conf @@ -12963,7 +12979,10 @@ lp: 核心選項 COMPAT_LINUX - 想要靜態連結 Linux Binary 相容性到自訂核心的使用者應加入 options COMPAT_LINUX 到自訂核心設定檔。 編譯並安裝新核心的方法,如 所述。 + Since the Linux binary compatibility layer has gained support + for running both 32- and 64-bit Linux binaries (on 64-bit x86 hosts), + it is no longer possible to link the emulation functionality statically + into a custom kernel. 手動安裝其他程式庫 @@ -14211,7 +14230,7 @@ run_rc_command "$1" # /etc/crontab - root's crontab for FreeBSD # -# $FreeBSD$ +# $FreeBSD$ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin @@ -14809,7 +14828,7 @@ ifconfig_fxp0_alias7="inet 202.0.75.20 netmask 255.255 此設定檔中一行代表一個動作,每一行的格式皆為一個選擇器欄位 (Selector field) 接著一個動作欄位 (Action field)。選擇器欄位的格式為 facility.level 可以用來比對來自 facility 於層級 level 或更高層的日誌訊息,也可以在層級前加入選擇性的比對旗標來更確切的指定記錄的內容。同樣一個動作可以使用多個選擇器欄位並使用分號 (;) 來分隔。用 * 可以比對任何東西。動作欄位可用來指定傳送日誌訊息的目標,如一個檔案或遠端日誌主機。範例為以下為 FreeBSD 預設的 syslog.conf - # $FreeBSD$ + # $FreeBSD$ # # Spaces ARE valid field separators in this file. However, # other *nix-like systems still insist on using tabs as field @@ -14889,7 +14908,7 @@ cron.* /var/l newsyslog 會讀取其設定檔 /etc/newsyslog.conf 來決定其要採取的動作,每個要由 newsyslog 所管理的日誌檔案會在此設定檔中設定一行,每一行要說明檔案的擁有者、權限、何時要翻轉該檔案、選用的日誌翻轉旗標,如:壓縮,以及日誌翻轉時要通知的程式。以下為 FreeBSD 的預設設定: # configuration file for newsyslog -# $FreeBSD$ +# $FreeBSD$ # # Entries which do not specify the '/pid_file' field will cause the # syslogd process to be signalled when that log file is rotated. This @@ -15306,7 +15325,7 @@ nameserver 147.11.100.30 /etc/hosts 是簡單的文字資料庫,會與 DNSNIS 一併使用來提供主機名稱與 IP 位址的對應。可將透過 LAN 所連結的在地電腦項目加入到這個檔案做最簡單的命名,來替代設定一個 named8 伺服器。除此之外 /etc/hosts 可以用來提供本地的網際網路名稱記錄,來減少常用名稱向外部 DNS 伺服器查詢的需求。 - # $FreeBSD$ + # $FreeBSD$ # # # Host Database @@ -17505,7 +17524,7 @@ Enter new password: rootkit 指的是嘗試未經授權取得系統 root 存取權的軟體。一旦安裝之後,這個惡意軟體將可以光明正大的開啟給另一個給攻擊者進入的大門。現實上,一但系統已被 rootkit 滲透且執行了搜索動作之後,該系統就應該從頭重新安裝,因為即使非常謹真的資安或系統工程式也可能會遺漏攻擊者留下的動西。 - rootkit 所做過的事可提供管理者一個非常有用的資訊:一但偵測到,便代表某處已經被滲透,但這類的應用程式躲藏的非常好,本節將會示範一個可以用來偵測 rootkit 的工具,security/rkhunter + rootkit 對管理者而言唯一有幫助的是:一但偵測到,便代表某處已經被滲透,但這類型的應用程式躲藏的非常好,本節將會示範一個可以用來偵測 rootkit 的工具,security/rkhunter 安裝此套件或 Port 之後,系統便可使用以下指令檢查。該指令提供許多資訊且會需要手動按下 ENTER 確認: @@ -18270,9 +18289,7 @@ kadmin> exit GSSAPIAuthentication yes - After making this change, sshd8 must be restared - for the new configuration to take effect: - service sshd restart. + 做完了這個變更之後,必須重新啟動 sshd8 來使新的設定值生效:service sshd restart @@ -18941,9 +18958,7 @@ Connection closed by foreign host. information on the IPsec subsystem in FreeBSD. - To add IPsec support to the kernel, add - the following options to the custom kernel configuration file - and rebuild the kernel using the instructions in : + 在 FreeBSD 11 與之後的版本預設會開啟 IPsec 功能,先前版本的 FreeBSD 可在自訂核心設定檔中加入以下選項然後依 的指示來重新編譯核心: 核心選項 IPSEC @@ -19072,10 +19087,10 @@ round-trip min/avg/max/stddev = 28.106/94.594/154.524/ network. The following commands will achieve this goal: - # corp-net# route add 10.0.0.0 10.0.0.5 255.255.255.0 -# corp-net# route add net 10.0.0.0: gateway 10.0.0.5 -# priv-net# route add 10.246.38.0 10.246.38.1 255.255.255.0 -# priv-net# route add host 10.246.38.0: gateway 10.246.38.1 + corp-net# route add 10.0.0.0 10.0.0.5 255.255.255.0 +corp-net# route add net 10.0.0.0: gateway 10.0.0.5 +priv-net# route add 10.246.38.0 10.246.38.1 255.255.255.0 +priv-net# route add host 10.246.38.0: gateway 10.246.38.1 At this point, internal machines should be reachable from each gateway as well as from machines behind the gateways. @@ -19386,8 +19401,8 @@ The key's randomart image is: 要在 Shell 使用 ssh-agent,使用 Shell 做為參數來啟動 ssh-agent。執行 ssh-add 來加入識別碼,然後輸入私鑰的密碼。使用者將可使用 ssh 連線到任何有安裝對應公鑰的主機,例如: - % ssh-agent csh -% ssh-add + % ssh-agent csh +% ssh-add Enter passphrase for key '/usr/home/user/.ssh/id_rsa': Identity added: /usr/home/user/.ssh/id_rsa (/usr/home/user/.ssh/id_rsa) % @@ -19777,7 +19792,7 @@ drwxr-xr-x 2 robert robert 512 Nov 10 11:54 public_ Affected package: cups-base-1.1.22.0_1 Type of problem: cups-base -- HPGL buffer overflow vulnerability. -Reference: <http://www.FreeBSD.org/ports/portaudit/40a3bca2-6809-11d9-a9e7-0001020eed82.html> +Reference: <https://www.FreeBSD.org/ports/portaudit/40a3bca2-6809-11d9-a9e7-0001020eed82.html> 1 problem(s) in your installed packages found. @@ -19917,7 +19932,7 @@ b) Execute the following commands as root: # patch < /path/to/patch Recompile the operating system using buildworld and installworld as -described in <URL:http://www.FreeBSD.org/handbook/makeworld.html>. +described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>. Restart the applicable daemons, or reboot the system. @@ -26311,7 +26326,7 @@ scsibus1: 在安全的地方保存這份列印結果與安裝媒體的複本,在緊急還原時可能會需要,接著開機進入安裝媒體並選擇 Live CD 以存取救援 Shell (Rescue shell),這個救援模式可以用來檢視目前系統的狀態,若有需要,可重新格式化磁碟然後自備份還原資料。 - FreeBSD/i386 10.3-RELEASE 的安裝媒體未含救援 Shell,針對該版本,可改自 ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/ISO-IMAGES/10.3/FreeBSD-10.3-RELEASE-i386-livefs.iso 下載 CD 映像檔並燒錄。 + FreeBSD/i386 10.4-RELEASE 的安裝媒體未含救援 Shell,針對該版本,可改自 ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/i386/ISO-IMAGES/10.4/FreeBSD-10.4-RELEASE-i386-livefs.iso 下載 Livefs CD 映像檔並燒錄。 然後,測試救援 Shell 下的備份。記錄下整個程序,將這份記錄隨媒體、列印結果、備份檔一併保存,這份記錄可以避免在緊張壓力下做緊急還原時因不慎造成備份的毀壞。 @@ -26860,7 +26875,8 @@ Quotas for user test: UFS file system, set the sector_size to 2048: - # gbde init /dev/ad4s1c -i -L /etc/gbde/ad4s1c.lock# $FreeBSD$ + # gbde init /dev/ad4s1c -i -L /etc/gbde/ad4s1c.lock +# $FreeBSD$ # # Sector size is the smallest unit of data which can be read or written. # Making it too small decreases performance and decreases available space. @@ -27292,7 +27308,7 @@ geli_da2_flags="-k /root/da2.key - This example configures an encryped swap partition using + This example configures an encrypted swap partition using the Blowfish algorithm with a key length of 128 bits and a sectorsize of 4 kilobytes: @@ -30500,7 +30516,7 @@ errors: No known data errors 匯入與匯出儲存池 - 儲存池在移動到其他系統之前需要做匯出 (Export),會卸載所有的資料集,然後標記每個裝置為已匯出,為了避免被其他磁碟子系統存取,因此仍會鎖定這些裝置。這個動作讓儲存池可以在支援 ZFS 的其他機器、其他作業系統做匯入 (Import),甚至是不同的硬體架構 (有一些注意事項,請參考 zpool8)。當資料集有被開啟的檔案,可使用 zpool export -f 來強制匯出儲存池,使用這個指令需要小心,資料集是被強制卸載的,因此有可能造成在該資料集開啟檔案的應用程式發生無法預期的結果。 + 儲存池在移動到其他系統之前需要做匯出 (Export),會卸載所有的資料集,然後標記每個裝置為已匯出,為了避免被其他磁碟子系統存取,因此仍會鎖定這些裝置。這個動作讓儲存池可以在支援 ZFS 的其他機器、其他作業系統做匯入 (Import),甚至是不同的硬體架構 (有一些注意事項,請參考 zpool8)。當資料集有被開啟的檔案,可使用 zpool export -f 來強制匯出儲存池,使用這個指令需要小心,資料集是被強制卸載的,因此有可能造成在該資料集開啟檔案的應用程式發生無法預期的結果。 匯出未使用的儲存池: @@ -30888,6 +30904,37 @@ NAME PROPERTY VALUE SOURCE tank custom:costcenter - - # zfs get all tank | grep custom:costcenter # + + + 取得與設定共享屬性 + + Two commonly used and useful dataset properties are the + NFS and SMB share + options. Setting these define if and how + ZFS datasets may be shared on the network. + At present, only setting sharing via NFS is + supported on FreeBSD. To get the current status of + a share, enter: + + # zfs get sharenfs mypool/usr/home +NAME PROPERTY VALUE SOURCE +mypool/usr/home sharenfs on local +# zfs get sharesmb mypool/usr/home +NAME PROPERTY VALUE SOURCE +mypool/usr/home sharesmb off local + + To enable sharing of a dataset, enter: + + # zfs set sharenfs=on mypool/usr/home + + It is also possible to set additional options for sharing + datasets through NFS, such as + , and + . To set additional options to a + dataset shared through NFS, enter: + + # zfs set sharenfs="-alldirs,-maproot=root,-network=192.168.1.0/24" mypool/usr/home + @@ -31036,17 +31083,16 @@ mypool/var/tmp 262K 93.2G 1 mypool/var/tmp@my_recursive_snapshot 88K - 152K - mypool/var/tmp@after_cp 53.5K - 118K - mypool/var/tmp@diff_snapshot 0 - 120K - -% ls /var/tmp -passwd passwd.copy -% rm /var/tmp/passwd* -% ls /var/tmp -vi.recover -% +# ls /var/tmp +passwd passwd.copy vi.recover +# rm /var/tmp/passwd* +# ls /var/tmp +vi.recover 在此時,使用者發現到刪除了太多檔案並希望能夠還原。ZFS 提供了簡單的方可以取回檔案,便是使用還原 (Rollback),但這只在有定期對重要的資料使用快照時可用。要拿回檔案並從最後一次快照重新開始,可執行以下指令: # zfs rollback mypool/var/tmp@diff_snapshot -% ls /var/tmp +# ls /var/tmp passwd passwd.copy vi.recover 還原操作會將資料集還原為最後一次快照的狀態。這也可以還原到更早之前,有其他在其之後建立的快照。要這麼做時,ZFS 會發出這個警告: @@ -31068,7 +31114,7 @@ mypool/var/tmp@diff_snapshot # zfs list -rt snapshot mypool/var/tmp NAME USED AVAIL REFER MOUNTPOINT mypool/var/tmp@my_recursive_snapshot 8K - 152K - -% ls /var/tmp +# ls /var/tmp vi.recover 可從 zfs list -t snapshot 的結果來確認 zfs rollback -r 會移除的快照。 @@ -31082,16 +31128,16 @@ vi.recover # zfs get snapdir mypool/var/tmp NAME PROPERTY VALUE SOURCE mypool/var/tmp snapdir hidden default -% ls -a /var/tmp +# ls -a /var/tmp . .. passwd vi.recover # zfs set snapdir=visible mypool/var/tmp -% ls -a /var/tmp +# ls -a /var/tmp . .. .zfs passwd vi.recover 要還原個別檔案到先前的狀態非常簡單,只要從快照中複製檔案到父資料集。在 .zfs/snapshot 目錄結構下有一個與先前所做的快照名稱相同的目錄,可以很容易的找到。在下個範例中,我們會示範從隱藏的 .zfs 目錄還原一個檔案,透過從含有該檔案的最新版快照複製: # rm /var/tmp/passwd -% ls -a /var/tmp +# ls -a /var/tmp . .. .zfs vi.recover # ls /var/tmp/.zfs/snapshot after_cp my_recursive_snapshot @@ -31277,18 +31323,18 @@ mypool@replica2 0 在傳送端系統上: - # zfs allow -u someuser send,snapshot mypool + # zfs allow -u someuser send,snapshot mypool 要掛載儲存池,無權限的使用者必須擁有該目錄且必須允許一般的使用者掛載檔案系統。在接收端系統上: - # sysctl vfs.usermount=1 + # sysctl vfs.usermount=1 vfs.usermount: 0 -> 1 -# echo vfs.usermount=1 >> /etc/sysctl.conf +# sysrc -f /etc/sysctl.conf vfs.usermount=1 # zfs create recvpool/backup # zfs allow -u someuser create,mount,receive recvpool/backup -# chown someuser /recvpool/backup +# chown someuser /recvpool/backup @@ -31406,7 +31452,7 @@ mypool/compressed_dataset compressratio 1.11x mypool/compressed_dataset compression lz4 local mypool/compressed_dataset logicalused 496G - - 資料集目前使用了 449 GB 的空間 (在 used 屬性)。在尚未壓縮前,該資料集應該會使用 496 GB 的空間 (於 logicallyused 屬性),這個結果顯示目前的壓縮比為 1.11:1。 + 資料集目前使用了 449 GB 的空間 (在 used 屬性)。在尚未壓縮前,該資料集應該會使用 496 GB 的空間 (於 logicalused 屬性),這個結果顯示目前的壓縮比為 1.11:1。 壓縮功能在與使用者配額 (User Quota) 一併使用時可能會產生無法預期的副作用。使用者配額會限制一個使用者在一個資料集上可以使用多少空間,但衡量的依據是以 壓縮後 所使用的空間,因此,若一個使用者有 10 GB 的配額,寫入了 10 GB 可壓縮的資料,使用者將還會有空間儲存額外的資料。若使用者在之後更新了一個檔案,例如一個資料庫,可能有更多或較少的可壓縮資料,那麼剩餘可用的空間量也會因此而改變,這可能會造成奇怪的現象便是,一個使用者雖然沒有增加實際的資料量 (於 logicalused 屬性),但因為更改影響了壓縮率,導致使用者達到配額的上限。 @@ -31430,10 +31476,9 @@ pool 2.84G 2.19M 2.83G 0% 1.00x ONLINE - DEDUP 欄位會顯示儲存池的實際去重複率,數值為 1.00x 代表資料尚未被去重複。在下一個例子會在前面所建立的去重複儲存池中複製三份 Port 樹到不同的目錄中。 - # zpool list -for d in dir1 dir2 dir3; do -for> mkdir $d && cp -R /usr/ports $d & -for> done + # for d in dir1 dir2 dir3; do +> mkdir $d && cp -R /usr/ports $d & +> done 已經偵測到重複的資料並做去重複: @@ -32277,7 +32322,7 @@ vfs.zfs.vdev.cache.size="5M" XXXTR: Though! The disks chapter, covers a bit of this and devfs under it's USB devices. It leaves a lot to be desired though, see: -http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/usb-disks.html +https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/usb-disks.html It may be better to flesh out that section a bit more. Add the word "camera" to it so that others can easily notice. @@ -32333,6 +32378,16 @@ http://www.freebsd.org/doc/en_US.ISO8859-1/books/handb bhyve section by + + + + + Benedict + Reuschling + + Xen section by + + @@ -32947,9 +33002,22 @@ perm vboxnetctl 0660 <trademark>VirtualBox</trademark> USB 支援 - VirtualBox 擴充包目前不支援 FreeBSD 主端系統,沒有這個擴充包,FreeBSD 主端系統無法傳遞 USB 埠給客端作業系統。 - + VirtualBox can be configured + to pass USB devices through to the guest + operating system. The host controller of the OSE version is + limited to emulating USB 1.1 devices until + the extension pack supporting USB 2.0 and 3.0 + devices becomes available on FreeBSD. + For VirtualBox to be + aware of USB devices attached to the + machine, the user needs to be a member of the operator group. + + # pw groupmod operator -m yourusername + + 重新啟動登作階段與 VirtualBox 來讓這些變更生效,且建立必要的 USB 的過濾器。 + + <trademark>VirtualBox</trademark> Host <acronym>DVD</acronym>/<acronym>CD</acronym> 存取 @@ -33066,7 +33134,7 @@ FreeBSD-10.3-RELEASE-amd64-bootonly.iso 100% of machine, used to track the running machines. This example starts the virtual machine in installation mode: - # sh /usr/share/examples/bhyve/vmrun.sh -c 4 -m 1024M -t tap0 -d guest.img -i -I FreeBSD-10.3-RELEASE-amd64-bootonly.iso guestname + # sh /usr/share/examples/bhyve/vmrun.sh -c 1 -m 1024M -t tap0 -d guest.img -i -I FreeBSD-10.3-RELEASE-amd64-bootonly.iso guestname The virtual machine will boot and start the installer. After installing a system in the virtual machine, when the @@ -33320,7 +33388,7 @@ crw------- 1 root wheel 0x1a1 Mar 17 12:19 othergu A specified virtual machine can be destroyed using bhyvectl: - # bhyvectl --destroy --vm=guestname + # bhyvectl --destroy --vm=guestname @@ -33355,18 +33423,332 @@ ifconfig_bridge0="addm igb0 - + Xen can migrate VMs between different Xen servers. When + the two xen hosts share the same underlying storage, the + migration can be done without having to shut the VM down first. + Instead, the migration is performed live while the DomU is + running and there is no need to restart it or plan a downtime. + This is useful in maintenance scenarios or upgrade windows to + ensure that the services provided by the DomU are still + provided. Many more features of Xen are listed on the Xen + Wiki Overview page. Note that not all features are + supported on FreeBSD yet. + + + Hardware Requirements for <trademark>Xen</trademark> Dom0 + + To run the Xen hypervisor on a host, certain hardware + functionality is required. Hardware virtualized domains + require Extended Page Table (EPT) + and Input/Output Memory Management Unit (IOMMU) + support in the host processor. + + + + <trademark>Xen</trademark> Dom0 Control Domain Setup + + The emulators/xen package works with + FreeBSD 11 amd64 binary snapshots and equivalent systems + built from source. This example assumes VNC output for + unprivileged domains which is accessed from a another system + using a tool such as net/tightvnc. + + Install emulators/xen: + + # pkg install xen + + Configuration files must be edited to prepare the host + for the Dom0 integration. An entry to + /etc/sysctl.conf disables the limit on + how many pages of memory are allowed to be wired. Otherwise, + DomU VMs with higher memory requirements will not run. + + # sysrc -f /etc/sysctl.conf vm.max_wired=-1 + + Another memory-related setting involves changing + /etc/login.conf, setting the + memorylocked option to + unlimited. Otherwise, creating DomU + domains may fail with Cannot allocate + memory errors. After making the change to + /etc/login.conf, run + cap_mkdb to update the capability database. + See for + details. + + # sed -i '' -e 's/memorylocked=64K/memorylocked=unlimited/' /etc/login.conf +# cap_mkdb /etc/login.conf + + Add an entry for the Xen console to + /etc/ttys: + + # echo 'xc0 "/usr/libexec/getty Pc" xterm on secure' >> /etc/ttys + + Selecting a Xen kernel in + /boot/loader.conf activates the Dom0. + Xen also requires resources like CPU and memory from the + host machine for itself and other DomU domains. How much CPU + and memory depends on the individual requirements and hardware + capabilities. In this example, 8 GB of memory and 4 + virtual CPUs are made available for the Dom0. The serial + console is also activated and logging options are + defined. + + # sysrc -f /boot/loader.conf hw.pci.mcfg=0 +# sysrc -f /boot/loader.conf xen_kernel="/boot/xen" +# sysrc -f /boot/loader.conf xen_cmdline="dom0_mem=8192M dom0_max_vcpus=4 dom0pvh=1 console=com1,vga com1=115200,8n1 guest_loglvl=all loglvl=all" + + Log files that Xen creates for the Dom0 and DomU VMs + are stored in /var/log/xen. This + directory does not exist by default and must be + created. + + # mkdir -p /var/log/xen +# chmod 644 /var/log/xen + + Xen provides a boot menu to activate and de-activate + the hypervisor on demand in + /boot/menu.rc.local: + + # echo "try-include /boot/xen.4th" >> /boot/menu.rc.local + + Activate the xencommons service during system + startup: + + # sysrc xencommons_enable=yes + + These settings are enough to start a Dom0-enabled + system. However, it lacks network functionality for the + DomU machines. To fix that, define a bridged interface with + the main NIC of the system which the DomU VMs can use to + connect to the network. Replace + igb0 with the host network + interface name. + + # sysrc autobridge_interfaces=bridge0 +# sysrc autobridge_bridge0=igb0 +# sysrc ifconfig_bridge0=SYNCDHCP + + Restart the host to load the Xen kernel and start the + Dom0. + + # reboot + + After successfully booting the Xen kernel and logging + into the system again, the Xen management tool + xl is used to show information about the + domains. + + # xl list +Name ID Mem VCPUs State Time(s) +Domain-0 0 8192 4 r----- 962.0 + + The output confirms that the Dom0 (called + Domain-0) has the ID 0 + and is running. It also has the memory and virtual CPUs + that were defined in /boot/loader.conf + earlier. More information can be found in the Xen + Documentation. DomU guest VMs can now be + created. + + + + <trademark>Xen</trademark> DomU 客端 VM 設置 + + Unprivileged domains consist of a configuration file and + virtual or physical hard disks. Virtual disk storage for + the DomU can be files created by truncate1 or ZFS + volumes as described in . + In this example, a 20 GB volume is used. A VM is + created with the ZFS volume, a FreeBSD ISO image, 1 GB of + RAM and two virtual CPUs. The ISO installation file is + retrieved with fetch1 and saved locally in a file + called freebsd.iso. + + # fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/10.3/FreeBSD-10.3-RELEASE-amd64-bootonly.iso -o freebsd.iso + + A ZFS volume of 20 GB called + xendisk0 is created to serve as the disk + space for the VM. + + # zfs create -V20G -o volmode=dev zroot/xendisk0 + + The new DomU guest VM is defined in a file. Some specific + definitions like name, keymap, and VNC connection details are + also defined. The following freebsd.cfg + contains a minimum DomU configuration for this example: + + # cat freebsd.cfg +builder = "hvm" +name = "freebsd" +memory = 1024 +vcpus = 2 +vif = [ 'mac=00:16:3E:74:34:32,bridge=bridge0' ] +disk = [ +'/dev/zvol/tank/xendisk0,raw,hda,rw', +'/root/freebsd.iso,raw,hdc:cdrom,r' + ] +vnc = 1 +vnclisten = "0.0.0.0" +serial = "pty" +usbdevice = "tablet" + + These lines are explained in more detail: + + + + This defines what kind of virtualization to use. + hvm refers to hardware-assisted + virtualization or hardware virtual machine. Guest + operating systems can run unmodified on CPUs with + virtualization extensions, providing nearly the same + performance as running on physical hardware. + generic is the default value and + creates a PV domain. + + + + Name of this virtual machine to distinguish it from + others running on the same Dom0. Required. + + + + Quantity of RAM in megabytes to make available to the + VM. This amount is subtracted from the hypervisor's total + available memory, not the memory of the Dom0. + + + + Number of virtual CPUs available to the guest VM. For + best performance, do not create guests with more virtual + CPUs than the number of physical CPUs on the host. *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***