I'm a graduate student trying to use a cluster at my university. These machines are shared, so I want to protect the source code I use (I signed a NDA, so I'm scared about publishing the code by accident or making it public very easily). So far, I managed to put my source code in a ecryptfs. To disable access from other users, I use:
unshare -m /bin/bash
and then:
mount -n -t ecryptfs ~home/crypt ~home/crypt
This works very nice on my workstation, encrypting the folder ~home/crypt only in the current session. Even the same user cannot access the encrypted files without mounting it again. The problem I have is that I need to be a sudoer to run these commands.
The cluster administrator gave access to:
sudo mount -n -t ecryptfs ~/crypt ~/crypt
But,
sudo unshare -m /bin/bash
would give me a root shell and this is a show stopper.
Is there another solution for this? Can a sudoers config solve this kind of problem?
I'm compiling a C++ system using some external libraries. So far, I'm building a VM to compile my code with the same libraries used on the Cluster (same Linux distro, etc). But this solution won't be ok for a long time, as Cluster updates would break my next build/release cycle. I will try to release my code in static mode too, but I really don't like this approach.
I'm using a Linux CentOS 6.3 64 bits (Intel) machine.
Source files are stored in a NAS (8TB) with FTP access and a very weak web interface.
chmod 700 $HOMEis probably the most... You can't really runmount -t ecryptfs ~home/crypt ^2on each cluster node...The unshare command drops potential privileges before executing the target program. This allows to setuid unshare.-- or sudo it. Though my experiments show this to be not true.