Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-15-2012, 05:12 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2009
Posts: 6
Rep:
|
Copying files encrypted with ecryptfs
Hi. I am trying to use ecryptfs for the first time.
I've created /mnt/backup/secret/ and /mnt/backup/plain/
and copied a directory (called '6') into /mnt/backup/plain/
Now I want to copy this encrypted dir /mnt/backup/secret/6/
to my Dropbox folder.
But using cp -av just copies the bare dir structure with no
actual encrypted files. Same with rsync. sudo makes no difference.
I get
cp: cannot open `6/lists.tex' for reading: Input/output error
errors. This also occurs with target dirs outside the Dropbox.
I don't know where to begin with this. Using Ubuntu 11.04
|
|
|
|
08-15-2012, 11:57 PM
|
#2
|
|
Member
Registered: Jun 2005
Location: Seattle, Ecotopia
Distribution: Debian Testing with xfce
Posts: 208
Rep:
|
Please use sshfs. You can remotely mount a filesystem by putting this in fstab:
Code:
sshfs#{user}@remotehost:/ /media/{localmountpoint} fuse user,auto,_netdev,cache=no,ServerAliveInterval=15,reconnect,allow_other,comment=sshfs 0 0
|
|
|
|
08-16-2012, 10:05 AM
|
#3
|
|
Member
Registered: Aug 2009
Distribution: CentOS
Posts: 692
|
Try unmounting the ecryptfs filesystem first. From the ecryptfs FAQ: Q. Can I access the lower files while eCryptfs is mounted?
Accessing the lower files during an active eCryptfs mount is somewhat like accessing a block device on which ext3 is mounted. The kernel allows it, and it may work (depending on what you do with the data), but it is not a good idea.
|
|
|
1 members found this post helpful.
|
08-17-2012, 08:31 AM
|
#4
|
|
LQ Newbie
Registered: Sep 2009
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by rknichols
Try unmounting the ecryptfs filesystem first. From the ecryptfs FAQ: Q. Can I access the lower files while eCryptfs is mounted?
Accessing the lower files during an active eCryptfs mount is somewhat like accessing a block device on which ext3 is mounted. The kernel allows it, and it may work (depending on what you do with the data), but it is not a good idea.
|
Thanks for this. (I'd read it, but not understood it.)
I tried this, but get `device is busy' messages.
I don't understand why moving or copying the files is difficult. The manpage says, right at the start,
Quote:
|
eCryptfs stores cryptographic metadata in the header of each file written, so that encrypted files can be copied between hosts;
|
so surely it ought to be easy to do?
I also tried mount --move /mnt/backup/secret /home/myname/Dropbox
This shifted the dir tree, but not the files, to Dropbox and made inaccessible the usual contents of Dropbox.
Maybe I should try sshfs as suggested above, or set up a vpn server on my home machine. What
I want to be able to do is the following: I use two desktops, home and office, a heavy laptop, a tablet, plus other desktops when I travel abroad. My Dropbox has about 30GB of stuff which can safely be kept in plain. I have another few GB of private stuff which I need to be able to get at, and edit, while away from the home machine. ecryptfs seemed like a good solution ...
|
|
|
|
08-17-2012, 01:08 PM
|
#5
|
|
Member
Registered: Aug 2009
Distribution: CentOS
Posts: 692
|
"Device is busy" means that some process has a file open or has its current working directory somewhere in the mounted (plaintext) directory. It's the same issue you'd run into if unmounting any other filesystem.
You could also try remounting the filesystem read-only:
Code:
mount -o remount,ro /mnt/backup/plain
That will be allowed unless there is a file open for writing or a file that is unlinked but still in use by some process.
|
|
|
|
08-18-2012, 06:35 AM
|
#6
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
Quote:
Originally Posted by rknichols
"Device is busy" means that some process has a file open or has its current working directory somewhere in the mounted (plaintext) directory. It's the same issue you'd run into if unmounting any other filesystem.
|
You can use the command lsof to get the process having files open there. This can also be an open terminal where the shell has the current working directory at this location.
|
|
|
|
08-18-2012, 11:42 AM
|
#7
|
|
Member
Registered: Aug 2009
Distribution: CentOS
Posts: 692
|
After some experiments to replicate your results, I think you might just have your mount command backwards. It should be:
Code:
mount -t ecryptfs crypted plain
or in /etc/fstab:
Code:
crypted plain ecryptfs {options} 0 0
You are mounting an encrypted "device" onto the (empty) plaintext directory, not the other way around.
The only way I could duplicate the "I/O error" behavior was by reversing the two mount arguments and thus writing plaintext data directly into the supposedly encrypted device.
Examples in documentation seem, for the most part, to show "overlay" mounts, where the two arguments are the same, making it a bit hard to see just what is going on.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:59 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|