mounting encrypted directory via command line

Any questions about the Command Line Interface can be placed here!
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
piro
I'm New!
I'm New!
Posts: 7
Joined: Tue Jul 31, 2012 4:43 pm

mounting encrypted directory via command line

Unread post by piro » Tue Aug 07, 2012 11:46 pm

Hello,

I'm setting up my DS212 (with DSM 4.0-2219) to perform unattended backups of my other computers in the network. The other machines run Linux and I'm using rsync over ssh for the backup.

Now, I want a few directories to be saved on an encrypted directory on the nas: at a command I'd like the directory to be mounted, rsync performed, then the dir unmounted again.

I'm currently failing even to mount the directory via command line: my attempt is:

Code: Select all

root@nas:~$ mkdir bagheera
root@nas:~$ mount -t ecryptfs /volume1/@bagheera@/ bagheera/
mount: mounting /volume1/@bagheera@/ on bagheera/ failed: Invalid argument
with /var/log/message showing:

Code: Select all

Aug  7 23:20:55 kernel: [607892.960000] ecryptfs_parse_options: You must supply at least one valid auth tok signature as a mount parameter; see the eCryptfs README
Aug  7 23:20:55 kernel: [607892.970000] Error parsing options; rc = [-22]
That was the example I've found googling for "synology ecryptfs". I haven't been proposed a prompt for the passphrase as the example reported.

Reading the README has not enlightened me either: what I've tried was:

Code: Select all

root@nas:~$ mount -t ecryptfs /volume1/@bagheera@/ bagheera/ -o key=passphrase:passfile=/root/bagheera.key  
which failed with the same messages.

So, how do I mount an encrypted dir using the file key generated for the encrypted directory? Ideally that data file will have to be read from stdin so that I'll be able to pass it from the machine performing the backup, but this can happen later: providing the key as a file name would be a way to start.

Thank you very much!

meonkeys
I'm New!
I'm New!
Posts: 2
Joined: Mon Dec 07, 2015 10:30 pm

Re: mounting encrypted directory via command line

Unread post by meonkeys » Tue Dec 15, 2015 7:29 pm

Here's how to mount an encrypted folder from busybox:

Code: Select all

synoshare --enc_mount share password
See also: http://forum.synology.com/enu/viewtopic ... 90&t=63785

roninXpl
Beginner
Beginner
Posts: 26
Joined: Thu Feb 11, 2016 7:56 pm
Contact:

Re: mounting encrypted directory via command line

Unread post by roninXpl » Thu Feb 25, 2016 6:14 pm

meonkeys wrote:Here's how to mount an encrypted folder from busybox:

Code: Select all

synoshare --enc_mount share password
Do you know by a chance how to do it with the key file instead of the password or how to extract the password from the key file?

Locked

Return to “Command Line Interface”