I was searching for a solution to mount an encrypted folder on my synology nas via terminal and found out that DSM uses ecryptfs. Using mount.ecryptfs $ENCRYPT_DIR_PATH $MOUNTED_DIR_PATH actually works but the mounted directory with decrypted data doesn't show in the samba shares or in the web GUI. Further i found out that synology made a program/script to solve this. synoshare --enc_mount $ENCRYPT_DIR_PATH $PASSWORD should mount the folder and make it visible but sadly it crashes.

Error SYNOShareEncShareMount() failed.[0x1400 share_db_get.c:31]

Does anyone know what the problem is here?


Someone who searches a way to do this might stumble upon this thread, so i want to warn you about something i read here. If you use synoshare --enc_mount $ENCRYPT_DIR_PATH $PASSWORD your password will be in plain text on the terminal and also in /var/log/bash_history.log which is obviously a security flaw. If you scroll down on the linked page you find a post from user fairlane in which he wrote a small script to use synoshare without revealing the password. For the sake of completeness i post it here.

echo -n "Enter Share Password: "
read -s passwordVariable
echo ""
/usr/syno/sbin/synoshare --enc_mount $1 $passwordVariable
  • 2
    I think you should add to the security warning section that the password you provide with this solution will still be visible in /var/log/auth.log. So anyone with root access to the system will be able to also find your encryption password(s). Now, one could of course in a normal home environment assume that strangers do not have root and it would be good enough. A persistent person with physical access may be able to extract /var/log/auth.log from the system, rendering the encryption useless.
    – mabahj
    Mar 28, 2019 at 19:39
  • 1
    You can avoid the auth.log entry by making sudo run bash and providing the command on stdin, eg: sudo bash <<<"synoshare --enc_mount $DIR $PW" (note <<< in bash means provide the string on stdin).
    – meuh
    Feb 29, 2020 at 14:28

1 Answer 1


I found out what was wrong. Instead of using synoshare --enc_mount $ENCRYPT_DIR_PATH $PASSWORD you use it like synoshare --enc_mount $SHARE_NAME $PASSWORD. So you have to put the actual name of the share using " " as argument instead of the concrete path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.