9

Now I mount an encrypted folder:

  1. open browser and login to NAS gui
  2. click Control panel -> Shared Folder > Encryption > Mount
  3. enter key
  4. after folder is mounted:

    rsync -ah --progress --delete /path/* admin@ipadress:/volume1/path/
    

Can I bypass 1.-3. and use ssh only?

Ohto Nordberg
  • 399
  • 6
  • 16

1 Answers1

10

Use the gui to mount the encrypted directory, then login to the synology as root over ssh and type mount. You will see a line like

 /volume1/@mycryptdir@ on /volume1/mycryptdir type ecryptfs (rw,relatime,ecryptfs_fnek_sig=88...,ecryptfs_sig=88...,ecryptfs_cipher=aes,ecryptfs_key_bytes=32)

This shows your directory /volume1/mycryptdir is implemented on an underlying /volume1/@mycryptdir@ directory using ecryptfs. Unmount the directory with the gui, then try the following command:

# ecryptfs-add-passphrase
Passphrase: 

Type in the cleartext passphrase you originally used (not the .key file). It will reply

Inserted auth tok with sig [88...] into the user session keyring

Now type the mount command using the options you saw before. You will need to create the mount point directory:

# mkdir /volume1/mycryptdir
# mount /volume1/\@mycryptdir\@/  /volume1/mycryptdir/ -t ecryptfs -o rw,relatime,ecryptfs_fnek_sig=88...,ecryptfs_sig=88...,ecryptfs_cipher=aes,ecryptfs_key_bytes=32

Your filesystem should now be mounted and useable. You should now clear the password from the in-memory keyring:

# keyctl clear @u

When you have finished, unmount the directory with umount /volume1/mycryptdir.

meuh
  • 49,672
  • 2
  • 52
  • 114