
我有一個用戶,比如說秘密用戶,附有加密的主目錄。不幸的是我忘了用戶的密碼秘密用戶,因為這是非常秘密的。所以我用另一個管理員使用者登入,比如說主用戶,並更改了密碼秘密用戶透過圖形使用者介面,例如“newpass”。嘗試登入時秘密用戶,當我使用“newpass”時,沒有出現“密碼錯誤”等情況,但在螢幕閃爍後我立即返回到圖形登入畫面。所以我再次登入主用戶並在 shell 視窗中執行:
masteruser$ su secretuser
我在提示符號下輸入“newpass”並能夠登入 shell。但仍無法進行圖形登入。效果和以前一樣。所以我得出結論,圖形對話框並沒有完全完成它的工作,並給了命令提示字元一個機會:
masteruser$ sudo passwd secretuser
當然,我必須更改為其他內容,例如“newpass1”。不幸的是,圖形登入顯示了與以前相同的問題,但是現在,當su
我秘密用戶,我只看到了一個加密的檔案系統。
masteruser@zhadum:~$ su secretuser
Passwort: newpass1
Signature not found in user keyring
Perhaps try the interactive 'ecryptfs-mount-private'
secretuser@zhadum:/home/masteruser$ cd /home/secretuser
secretuser@zhadum:~$ ls
Access-Your-Private-Data.desktop README.txt
secretuser@zhadum:~$
也許我在安全方面做得有點太過分了,因為現在我完全陷入困境了。看似修改了密碼,但對於圖形登入不起作用,也不利於使用者目錄的解密。按照建議進行嘗試ecryptfs-mount-private
也不起作用,因為「newpass」和「newpass1」都沒有被接受。刪除並重新建立用戶會讓我損失 3 週的工作,因為最近的備份不太最新,這讓我感到羞恥。
我還有機會再訪嗎?
更新:感謝@mxdsp 給出的鏈接,我嘗試過:
masteruser@zhadum:~$ sudo ecryptfs-recover-private
[sudo] password for masteruser: ----
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/home/.ecryptfs/secretuser/.Private].
Try to recover this directory? [Y/n]:
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] Y
INFO: Enter your LOGIN passphrase...
Passphrase: newpass1
Error: Unwrapping passphrase and inserting into the user session keyring failed [-5]
Info: Check the system log for more information from libecryptfs
masteruser@zhadum:~$ cd /var/log
masteruser@zhadum:/var/log$ tail syslog
Oct 9 06:05:19 zhadum ecryptfs-insert-wrapped-passphrase-into-keyring: Incorrect wrapping key for file [/home/.ecryptfs/secretuser/.Private/../.ecryptfs/wrapped-passphrase]
Oct 9 06:05:19 zhadum ecryptfs-insert-wrapped-passphrase-into-keyring: Error attempting to unwrap passphrase from file [/home/.ecryptfs/secretuser/.Private/../.ecryptfs/wrapped-passphrase]; rc = [-5]
Oct 9 06:05:21 zhadum wpa_supplicant[1625]: nl80211: send_and_recv->nl_recvmsgs failed: -33
並且:
masteruser@zhadum:/var/log$ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
INFO: Found [/home/.ecryptfs/secretuser/.Private].
Try to recover this directory? [Y/n]: Y
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n] n
INFO: To recover this directory, you MUST have your original MOUNT passphrase.
INFO: When you first setup your encrypted private directory, you were told to record
INFO: your MOUNT passphrase.
INFO: It should be 32 characters long, consisting of [0-9] and [a-f].
Enter your MOUNT passphrase: byebye secretuser...
我想我現在已經完成了。我現在為我的愚蠢行為感到悲傷,然後問另一個問題如何真正刪除 32 GB秘密用戶從我的硬碟 - 確保不會留下更多混亂...
答案1
答案2
你確實需要
最後一個登入密碼(您使用 強制輸入新登入密碼之前的密碼
sudo
)或者
設定加密時所建立的原始安裝密碼。
該wrapped-passphrase
檔案包含您的加密主目錄的安裝密碼,並使用您的登入密碼進行加密。透過使用 sudo 強制使用新密碼,在沒有舊密碼或未登入的情況下,您的wrapped-passphrase
檔案不會被解密並使用新的登入密碼重新加密。這樣做的目的是提供任何sudo
武裝用戶都無法繞過的真正安全性。
當您使用 eCryptFS 工具設定加密主目錄時,ecryptfs-migrate-home
它會要求您製作實際安裝密碼的備份副本,以防出現此類問題(您忘記了登入密碼或檔案wrapped-passphrase
遺失或損壞)。
僅擁有首次建立使用者時的登入密碼可能沒有用,除非您同時擁有wrapped-passphrase
使用相同登入密碼的文件副本。