太小的硬碟上的 ecryptfs - 如何將連結新增到加密中?

太小的硬碟上的 ecryptfs - 如何將連結新增到加密中?

我的主目錄使用 ecryptfs。我現在想切換到 SSD,但我的主目錄目前大小為 350GB,而我沒有錢購買該大小的 SSD。我得到的是一個128GB的SSD,我想在上面安裝根系統,以及我的主目錄的“基礎”(包括源代碼,配置文件,即最常用的文件)。所有包含大量資料但很少存取的子目錄(音樂、圖片、文件)我想保留在普通硬碟上並僅連結目錄。對於圖片和文檔,我確實想保持加密。

是否有一種官方/高效/簡單/安全的方法將目錄從另一個位置軟連結到我的主目錄並加密?理想情況下,ecryptfs 會自動處理這個問題,但是自動掛載這些目錄(最好至少是半自動但絕對安全)將是一個可以接受的折衷方案。

答案1

您可以使用以下方法來完成此操作mount.ecryptfs_private的別名功能。從線上說明頁:

   mount.ecryptfs_private  is a mount helper utility for non-root users to
   cryptographically mount a private directory, ~/Private by default.

   This program  optionally  takes  one  argument,  ALIAS.   If  ALIAS  is
   omitted, the program will default to using "Private" using:
    - $HOME/.Private as the SOURCE
    - $HOME/Private as the DESTINATION
    - $HOME/.ecryptfs/Private.sig for the key signatures.

   If ALIAS is specified, then the program will look for an fstab(5) style
   configuration in:
    - $HOME/.ecryptfs/ALIAS.conf and for key signature(s) in:
    - $HOME/.ecryptfs/ALIAS.sig

相關內容