Greg Hughes

auth-user-pass for Synology OpenVPN

Since my post about Putting a Synology DiskStation to Good Use, a number of people have emailed me to report the following error:

Mon Dec 5 18:08:48 2011 Sorry, ‘Auth’ password cannot be read from a file

Another one I’ve seen is:

Failed to enable OpenVPN. Please check the configuration file

These errors occur when your VPN provider requires password authentication. Some providers include the password in a file so you don’t have to type it in; others require you to type it in whenever you log on.

Synology compiled their build of OpenVPN with password file support disabled, as is standard for OpenVPN builds. Fortunately, there is a one-byte patch to /usr/local/synovpn/sbin/openvpn which reverses that: just change the byte at 0x21113 from 0A to EA. This modifies the control flow within OpenVPN to permit reading from password files. (Note that this will only work on OpenVPN 2.1.4 for ARM, built by Synology on 24/08/2011, with MD5 hash d6305ae735b3e49c360fc1be5eccb539.)

I’ve prepared a pre-patched copy, which is available for download here. Follow these instructions to get it working:

  1. (Skip this if you aren’t prompted for a username/password when you connect to your VPN provider.) Create a file named pass.txt in /usr/syno/etc/synovpn/openvpn – the first line should be your username; the second should be your password. Then add auth-user-pass pass.txt to openvpn.conf.user.

  2. Replace /usr/local/synovpn/sbin/openvpn with the one provided above.

  3. Make the replacement executable: chmod +x /usr/local/synovpn/sbin/openvpn

Please let me know whether this worked for you by leaving a note in the comments.

Update: download this instead if your Synology device has an x86 CPU. You can check here if you’re not sure.

Comments