How do I find the passphrase which encrypts my home directory?

240

With ecryptfs-unwrap-passphrase

[On the off-chance that there's not something funny about this question, maybe there's a legitimate language barrier or some other issue, might as well make it an "official answer"]


Hints:

  • You might want to make a backup of eCryptfs's important files too, in /home/.ecryptfs/<user>/.ecryptfs/ especially the wrapped-passphrase file - if it gets damaged your home's really inaccessible even if you remember the passphrase.

    The ecryptfs-unwrap-passphrase tool takes that file and your passphrase, and reveals the actual "random" encryption key.

  • Your actual encrypted files are stored in /home/.ecryptfs/<user>/.Private/, but alone they're useless without the wrapped-passphrase file + passphrase.

  • You should have a backup of any important files in your encrypted home, it's a lot easier than trying to recover from failing drives or overwritten encryption.

[eCryptfs encrypted home - explanation - on Superuser]

Share:
240

Related videos on Youtube

Ben Peretz
Author by

Ben Peretz

Updated on September 18, 2022

Comments

  • Ben Peretz
    Ben Peretz almost 2 years

    I have been trying to create a program that sends multiple packets via sendto to different IP addresses, but after exactly 1238 callings to sendto I'm getting the error: "SendTo: Invalid argument" (printed by perror). Edit: After an hour the number of callings to sendto is exactly 1231 and remains like that every run. After I added a code that prints something on the screen, it was back to 1238 callings every run until error, deleted that code, it became 1241 and about an hour later it's 1231. If I take down the IP addresses (making the aliases offline), it sends those packets correctly without an error but it get stuck for a moment after about every 500 sendto callings,

    This error only happens when those IP addresses are not in the same server, when they are in the same server (aliases) the sendto works correctly. Also, the error doesn't appear when sending to the same IP multiple times instead of multiple times to different IP addresses.

    I have tried different fixes that I found when searching in Google. I have tried playing with the configurations in sysctl.conf file, raised the send buffer, somaxconn, backlog, and other things.. When I raised the send buffer, I have also raised the buffer in the application itself.

    Here is the sample code I have written: http://pastebin.com/FCn0ALzn

    And the code that gives the error:

    for (size_t i = 0; i < ips.size(); i++)
        {
            cout << i << ") Sending message to: " << ips[i] << endl;
            server.sin_addr.s_addr = inet_addr(ips[i].c_str());
            n = sendto(sock, buffer, strlen(buffer), 0, (const struct sockaddr *)&server, length);
            if (n < 0)
            {
                perror("Sendto");
                return;
            }
        }
    
    • molbdnilo
      molbdnilo over 7 years
      Put the code in the question. And read about why while (!file.eof()) is wrong.
    • nos
      nos over 7 years
      Are you sure ips[i].c_str() returns a valid IP address, and you're not passing some string to inet_addr() that it cannot parse after 1238 calls ?
    • Stephen Kitt
      Stephen Kitt over 6 years
      The dialog box tells you how to find the recovery passphrase, doesn’t it?
    • Alessio
      Alessio over 6 years
      I'm voting to close this question as off-topic because this question is not about unix or linux, it's about failing to read the explicit instructions on screen that directly answers the question asked by providing the exact command line to run (ecryptfs-unwrap-passphrase).
    • spraff
      spraff over 6 years
      Sincerely, thank you for pointing out the obvious. I was very tired :-/
  • Ben Peretz
    Ben Peretz over 7 years
    I have printed the output of ips[i].c_str() and the output of server.sin_addr using inet_ntoa, they both printed the correct IP.