Needs simple script to unencrypt private home
Bug #1195399 reported by
TJ
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ecryptfs-utils (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Ubuntu 13.04 Raring amd64
It would be useful if, as well as the (inconvenient) instructions for un-encrypting a user's home directory:
ecryptfs-
that the package includes a new tool:
ecryptfs-
Needing this recently I created the attached shell script.
It can be used by the user whilst logged in and using the encrypted folder from a console TTY terminal or ssh session. Currently it might cause issues for GUI sessions that maintain open files/sockets in the home directory.
To post a comment you must log in.
If you wish to test this script here's the procedure.
1. Download and install
2. Give execute permissions
3. Create a test user account
4. Log-in as the test user
5. Run the script
6. Log-out/in/out as test user
7. Delete the test user account
# Download and install /bugs.launchpad .net/ubuntu/ +source/ ecryptfs- utils/+ bug/1195399/ +attachment/ 3716219/ +files/ ecryptfs- unencrypt- home | sudo dd of=/usr/local/bin
$ wget -O - https:/
# Give execute permissions bin/ecryptfs- unencrypt- home
$ sudo chmod a+x /usr/local/
# Create a test user account
$ sudo adduser --encrypt-home test_e
# Log-in as the test user
$ su -l test_e
test_e@ubuntu:~$
# Run the script. It will check whether /home/ is on a separate file-system unencrypt- home Ubuntu- Home /tmp/mnt/home
test_e@ubunut:~$ ecryptfs-
Found a separate /home/ file-system
[sudo] password for test_e:
Some commands in this script (mount) will request 'sudo' privileges.
Sorry, user test_e may not run sudo. Please use an account with privileges to run the following commands and then re-run this script:
sudo mkdir -p /tmp/mnt/home
sudo mount /dev/mapper/
# At this point the script has determined that the user doesn't have mount permissions and requires another user account to perform these steps. At another terminal using a sudo-privileged account follow the instructions:
$ sudo mkdir -p /tmp/mnt/home Ubuntu- Home /tmp/mnt/home
$ sudo mount /dev/mapper/
# And now, at the test_e session, re-run the script. It will check the mount has been performed before continuing:
test_e@ubuntu:~$ ecryptfs- unencrypt- home
Found a separate /home/ file-system
[sudo] password for test_e:
Contents of the new, unencrypted home, are currently: Your-Private- Data.desktop -> /usr/share/ ecryptfs- utils/ecryptfs- mount-private. desktop ecryptfs/ test_e/ .ecryptfs ecryptfs/ test_e/ .Private ecryptfs- utils/ecryptfs- mount-private. txt
total 8
dr-x------ 2 test_e test_e 4096 Jun 27 18:33 .
drwxr-xr-x 8 root root 4096 Jun 27 18:33 ..
lrwxrwxrwx 1 test_e test_e 56 Jun 27 18:33 Access-
lrwxrwxrwx 1 test_e test_e 32 Jun 27 18:33 .ecryptfs -> /home/.
lrwxrwxrwx 1 test_e test_e 31 Jun 27 18:33 .Private -> /home/.
lrwxrwxrwx 1 test_e test_e 52 Jun 27 18:33 README.txt -> /usr/share/
Copying encrypted home files to unencrypted location, this may take some time...
sending incremental file list
./
.bash_logout
.bashrc
.profile
examples.desktop
sent 13859 bytes received 91 bytes 27900.00 bytes/sec
total size is 13537 speedup is 0.97
Switching to the unencrypted home...
INFO: Your private directory has been unmounted.
INFO: To see this change in your current shell:
cd /home/test_e
...done.
Moving but preserving the .ecryptfs links (in case you want to reverse the process) e/.ecryptfs- home/
ecryptfs links are now in /home/test_
Your unencrypted files have not been deleted from /home/. ecryptfs/ test_e unencrypt- home --really- delete- encrypted- files
If you really want to delete them (and the .ecryptfs links) re-run this script with:
ecryptfs-
Sorry, user test_e may not run sudo. Please use an account with privileges to run the following commands:
sudo umount /tmp/mnt/home
sudo rmdir /tmp/mnt/home
sudo rmdir /tmp/mnt
Finished.
# Log-out from t...