
ubuntu取消主目錄加密

Access an encrypted home directory when you’re not logged in – say, from a live CD – and all you’ll see is a README file. You’ll need a terminal command to recover your encrypted files.
當您未登錄時(例如,從實時CD)訪問加密的主目錄,您將看到的只是一個README文件。 您將需要一個終端命令來恢復您的加密文件。
You should also back up your mount passphrase ahead of time – you may need this in the future. While eCryptfs normally decrypts your files with your login passphrase, the mount passphrase may be necessary if eCryptfs’s files become lost.
您還應該提前備份裝載密碼短語–將來可能會需要。 盡管eCryptfs通常使用您的登錄密碼來解密文件,但是如果eCryptfs的文件丟失了,則可能需要掛載密碼。
備份加密密碼短語 (Back Up Encryption Passphrase)
If you use an encrypted Ubuntu home directory, you should keep a backup copy of your mount passphrase. You’ll see a dialog prompting you to do so after encrypting your home directory. Write down this passphrase and keep it somewhere safe – you may need it to recover your files in the future.
如果使用加密的Ubuntu主目錄,則應保留安裝密碼的備份副本。 加密主目錄后,您會看到一個對話框提示您這樣做。 寫下該密碼短語并將其保存在安全的地方–將來可能需要它來恢復文件。

If you want to acquire this mount passphrase at a later date, just run the ecryptfs-unwrap-passphrase command while logged in.
如果您想在以后獲取此安裝密碼,只需在登錄時運行ecryptfs-unwrap-passphrase命令即可。

You can still recover your encrypted files without this mount passphrase, assuming the ecryptfs wrapped passphrase is still available on your hard drive. However, if you lose this data or it becomes corrupted, you’ll need the mount passphrase to recover your files.
您仍然可以在沒有此安裝密碼的情況下恢復加密文件,前提是您的硬盤驅動器上仍保留了ecryptfs包裝的密碼。 但是,如果丟失此數據或數據損壞,則需要安裝密碼短語來恢復文件。
從Live CD中恢復 (Recovering From a Live CD)
You can recover your files by booting from a Ubuntu live CD or USB drive. If you still have the disc or USB drive you installed Ubuntu from, you can use that. Otherwise, you can download an ISO from Ubuntu’s website and place it on a CD, DVD, or USB drive.
您可以通過從Ubuntu Live CD或USB驅動器啟動來恢復文件。 如果仍然有從中安裝Ubuntu的光盤或USB驅動器,則可以使用它。 否則,您可以從Ubuntu網站下載ISO并將其放在CD,DVD或USB驅動器上。
Log in to the live Ubuntu environment and ensure the partition containing your encrypted home directory is mounted. You can easily mount it by clicking It in the file manager – you’ll see an eject (unmount) icon, indicating the partition is mounted.
登錄到實時Ubuntu環境,并確保已安裝包含加密主目錄的分區。 您可以通過在文件管理器中單擊“它”來輕松安裝它-您將看到一個彈出(卸載)圖標,指示該分區已安裝。

Next, fire up a terminal and run the following command to search your mounted file systems for encrypted private directories
接下來,啟動一個終端并運行以下命令以在已安裝的文件系統中搜索加密的私有目錄
sudo ecryptfs-recover-private
sudo ecryptfs恢復專用

The command will offer to recover an encrypted directory if it locates one.
如果找到一個加密目錄,該命令將提供恢復該目錄的功能。

Assuming the command found a wrapped passphrase file on your system, it will prompt you for your login passphrase. If it doesn’t find this file, you’ll need the mount passphrase from the ecryptfs-unwrap-passphrase command – hopefully you have a copy of this. If you don’t, you can’t recover your files.
假設該命令在您的系統上找到了一個包裝好的密碼短語文件,它將提示您輸入登錄密碼短語。 如果找不到該文件,則需要使用ecryptfs-unwrap-passphrase命令中的mount密碼-希望您有一個副本。 否則,您將無法恢復文件。

The command will mount the encrypted directory in your /tmp directory.
該命令會將加密的目錄掛載到/ tmp目錄中。

You can access this directory to view the decrypted versions of your files. However, you may not have read access to this directory as the live CD user.
您可以訪問此目錄以查看文件的解密版本。 但是,您可能沒有實時CD用戶對此目錄的讀取權限。

To access the directory with a graphical file browser, run Nautilus as root. Press Alt+F2, type gksu nautilus, and press Enter.
要使用圖形文件瀏覽器訪問目錄,請以root用戶身份運行Nautilus。 按Alt + F2,鍵入gksu nautilus ,然后按Enter。

You’ll be able to access your files from the Nautilus window running as root. From here, you can easily copy the files to an external hard drive or another location.
您將可以從以root用戶身份運行的Nautilus窗口中訪問文件。 從這里,您可以輕松地將文件復制到外部硬盤驅動器或其他位置。

翻譯自: https://www.howtogeek.com/116297/how-to-recover-an-encrypted-home-directory-on-ubuntu/
ubuntu取消主目錄加密