- accessible as a mountable network filesystem;
- with the content being encrypted;
- easily configurable.
- SSHFS does not need to perform any configuration on the server, it lasts the SSH connection to be configured (that is often done already);
- SSHFS does not need any new special ports to be open on the firewall (SSH port is sufficient).
The desired configuration is as follows:
- On the server, I want an encrypted directory available over the SSHFS. Thus, the shared directory would be
/home/user/sharedthat would contain encrypted directory/home/user/shared/encrypted. - On the client a remote directory would exist,
/home/user/.remotedir, that would contain encrypted subdirectoryencrypted, which I want to mount to the decrypted directory/home/user/Remote. - Only the
/home/user/Remotedirectory would be used by me and EncFS will encrypt all the content into/home/user/.remotedir/encryped, which in turn would be remotely stored via SSHFS on the server.
Server configuration
- Make sure SSH is up and running.
- Create shared directory:
mkdir /home/user/shared - Inside of the shared directory create encrypted directory:
mkdir /home/user/shared/encrypted - Update permissions:
chmod -R o-rwx /home/user/shared
Client configuration
- Install SSHFS and EncFS:
sudo apt-get install sshfs encfs - Create directory for mounting the remote directory
mkdir /home/user/.remotedir - Create directory for mounting the encrypted remote directory:
mkdir /home/user/Remote - Mount the remote directory using SSHFS (insert SSH password to the server):
sshfs user@myserver.org:/home/user/shared /home/user/.remotedir - Enable encryption:
encfs /home/user/.remotedir/encrypted /home/user/Remote
The computer would ask you the type of instalation. Hit ENTER to select "standard". Then insert password for the encrypted content. - To unmount everything, you should first unmount the encrypted volume and then the SSHFS:
fusermount -u /home/user/Remote
fusermount -u /home/user/.remotedir - That's all.
- mountRemote:
#!/bin/bash
sshfs user@myserver.org:/home/user/shared /home/user/.remotedir
encfs /home/user/.remotedir-hucak/encrypted /home/user/Remote - umountRemote:
#!/bin/bash
fusermount -u ~/Remote
fusermount -u ~/.remotedir-hucak
No comments:
Post a Comment