Results 1 to 7 of 7

Thread: How do I encrypt swap?

  1. #1
    Join Date
    Nov 2008
    Beans
    88

    How do I encrypt swap?

    I selected encryption when installing. This encrypted my HOME folder and was pleasantly surprised to find that it also encrypted swap. However, during some re-partitioning stuff I was forced to re-format my swap, as swap.

    Is there a way to re-encrypt swap without doing a clean install?

  2. #2
    Join Date
    Jan 2010
    Location
    Kolkata India
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How do I encrypt swap?

    Quote Originally Posted by ToshibaLaptoplinux View Post
    I selected encryption when installing. This encrypted my HOME folder and was pleasantly surprised to find that it also encrypted swap. However, during some re-partitioning stuff I was forced to re-format my swap, as swap.

    Is there a way to re-encrypt swap without doing a clean install?
    Although you can configure particular applications such as vi not to write to swap space, you can not configure the kernel to do so. When memory is low, the kernel will swap the contents of the page to the swap space. The contents of this page can include such sensitive contents as your bank PIN, your passwords or GPG passphrase. This information is in cleartext which means an attacker can read the contents at their leisure. Encrypting your swap space protects its contents against unauthorized reading and various forensic attacks should your machine be removed from your possession and/or compromised.

    https://help.ubuntu.com/community/En...ilesystemHowto
    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein

  3. #3
    Join Date
    Nov 2008
    Beans
    88

    Re: How do I encrypt swap?

    Quote Originally Posted by codemaniac View Post
    Although you can configure particular applications such as vi not to write to swap space, you can not configure the kernel to do so. When memory is low, the kernel will swap the contents of the page to the swap space. The contents of this page can include such sensitive contents as your bank PIN, your passwords or GPG passphrase. This information is in cleartext which means an attacker can read the contents at their leisure. Encrypting your swap space protects its contents against unauthorized reading and various forensic attacks should your machine be removed from your possession and/or compromised.

    https://help.ubuntu.com/community/En...ilesystemHowto
    Thanks. Thus my question, how can I re-encrypt swap? The initial install did so there must be a way.

  4. #4
    Join Date
    Sep 2010
    Beans
    898

    Re: How do I encrypt swap?

    Code:
    sudo ecryptfs-setup-swap
    Back up these files first: /etc/crypttab, /etc/fstab
    Last edited by Dave_L; May 30th, 2012 at 03:04 AM.

  5. #5
    Join Date
    Jan 2010
    Location
    Kolkata India
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How do I encrypt swap?

    yes as suggested above ,You might need the ecryptfs-utils package.
    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein

  6. #6
    Join Date
    Nov 2008
    Beans
    88

    Re: How do I encrypt swap?

    Thanks for the replies. I tried to use the command provided and this error was thrown back;

    WARNING: [/dev/dm-0] already appears to be encrypted, skipping.
    WARNING: There were no usable swap devices to be encrypted. Exiting.
    Which leads me to believe swap is still encrypted. However if I look in any disk management tool (GParted, Win7 Disk Management, etc.) it still shows up as not being encrypted.

    Any other suggestions?

  7. #7
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    7,955

    Re: How do I encrypt swap?

    The best way, I would say the only way, is to use 'whole disk' encryption. Since swap is on there, it will also be encrypted when the system is at rest.

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
  •