Results 1 to 4 of 4

Thread: Recovering Encrypted Home Folder

  1. #1
    Join Date
    Sep 2010
    Beans
    2

    Question Recovering Encrypted Home Folder

    After a borked upgrade from 13.10 to 14.04, I fsync'ed my previous (encrypted) home folder to an external drive and restarted with a fresh instal of 14.04. How can I recover this data? I don't have the passphrase, although I do remember the old login password. I still have the "wrapped-passphrase" and ".wrapped-passphrase.recorded" files, under [externaldrive]/home/.encryptfs/[username]/.encryptfs/, although tutorials I have attempted have failed so far...

  2. #2
    Join Date
    Nov 2005
    Beans
    145

    Re: Recovering Encrypted Home Folder

    Try the attached script. You have to adjust the variables ROOT and TARGET.

    Code:
    #!/bin/sh
    
    ROOT=/tmp/backup/mnt/.ecryptfs/whoopie
    TARGET=/tmp/backup/user/home/whoopie
    
    # ROOT should be the parent of the .ecryptfs and .Private folders
    
    mkdir -p $TARGET
    cd $ROOT
    
    echo Type your password:
    PASS=$(ecryptfs-unwrap-passphrase .ecryptfs/wrapped-passphrase | sed s/Passphrase:\ //)
    SIG1=$(head -n1 .ecryptfs/Private.sig)
    SIG2=$(tail -n1 .ecryptfs/Private.sig)
    
    echo Passphrase:
    echo $PASS
    echo Signatures:
    echo $SIG1
    echo $SIG2
    
    echo Should be empty:
    keyctl clear @u
    keyctl list @u
    
    echo Do not type anything:
    echo $PASS | sudo ecryptfs-add-passphrase --fnek
    
    echo Sould have signatures:
    keyctl list @u
    
    echo Mounting $ROOT on $TARGET...
    mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,ecryptfs_sig=$SIG1,ecryptfs_fnek_sig=$SIG2,passwd=$(echo $PASS) $ROOT/.Private $TARGET
    
    ls $TARGET
    Last edited by Whoopie; July 15th, 2014 at 08:01 AM.

  3. #3
    Join Date
    Sep 2010
    Beans
    2

    Re: Recovering Encrypted Home Folder

    Thank you, so so much

  4. #4
    Join Date
    Nov 2008
    Beans
    482

    Re: Recovering Encrypted Home Folder

    You can recover the "real" passphrase with tool ecryptfs-unwrap-passphrase and the old wrapped-passphrase file:
    ecryptfs-unwrap-passphrase wrapped-passphrase
    This tool will ask for "passphrase" which in this case is the same as "login passphrase" which actually is the old login password.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •