<p>Hello,<br />
I would like to install a password query in a VirtualHere installation on a Synology.
</p>
<p>I created auth.sh in the Synolgy directory on /volume1/@appstore/VirtualHere<br />
I added the Example 1 from https://www.virtualhere.com/authorization<br />
I gave it execute permissions (chmod +x auth.sh)
</p>
<p>I added the clientAuthorization in the config.ini in /volume1/@appstore/VirtualHere<br />
clientAuthorization=/volume1/@appstore/VirtualHere/auth.sh "$VENDOR_ID$" "$PRODUCT_ID$" "$CLIENT_ID$" "$CLIENT_IP$" "$PRODUCT_SERIAL$" "$PASSWORD$" "$DEVPATH$" "$NICKNAME$" "$NUM_BINDINGS$"
</p>
<p>what else do I have to set in the client?<br />
I would just need a simple password query
</p>
<p>kind regards<br />
Martin
</p>
.
Nothing needs to change in the client. Its only a server setting
1. Put this into /volume1/@appstore/VirtualHere/auth.sh
2. Stop the VirtualHere package in the DSM Package Center
3. Edit the config.ini file and add the line
4. Save the config.ini changes and start the virtualhere server using the DSM
5. Try to use a device, when it asks for a password put in mypassword
There was a error using this device
Hi Michael,
- I inserted the file auth.sh
- I stopped the VH Server
- the file config.ini has been edited
- I restarted the server
when I try to use the dongle, the error message appears "There was a error using this device"
access permissions
<p>-rwxrwxrwx 1 admin users 825 Mar 25 09:02 auth.sh<br />
-rwxrwxrwx 1 admin users 415 Mar 25 09:34 config.ini<br />
drwxrwxr-x 1 root root 80 Mar 14 15:34 ui<br />
-rwxrwxr-x 1 root root 390276 Mar 11 01:41 vhusbd<br />
-rwxrwxr-x 1 root root 118 Mar 11 01:41 VirtualHere.sc</p>
.
On the synology go to /var/log/virtualhere.log and see what it says in there. Any errors will be logged there
virtualhere.log
Mon Mar 25 10:15:35 2019 LOG_INFO >>> Shutdown <<<
Mon Mar 25 10:15:37 CET 2019 Stopped successfully
Mon Mar 25 10:15:49 CET 2019 Starting VirtualHere...
Mon Mar 25 10:15:50 2019 LOG_INFO >>> Starting VirtualHere USB Server v3.8.5 (Built: Mar 11 2019, 11:38:52)<<<
Mon Mar 25 10:15:50 2019 LOG_INFO Using configuration /volume1/@appstore/VirtualHere/config.ini
Mon Mar 25 10:15:50 CET 2019 Started successfully
Mon Mar 25 10:15:50 2019 LOG_INFO Server licensed to=XXXXXXXXXXXX max_devices=unlimited
Mon Mar 25 10:15:50 2019 LOG_INFO Using large URB's
Mon Mar 25 10:15:50 2019 LOG_INFO Listening on all network interfaces at TCP port 17570
Mon Mar 25 10:15:50 2019 LOG_INFO Found Full speed device [0529:0001] "XXXXXXL" at address 13
Mon Mar 25 10:16:04 2019 LOG_INFO xxx.xxx.xxx.xxx connected as connection 1
Mon Mar 25 10:16:06 2019 LOG_ERR Unknown return value 126 from clientAuthorization
Mon Mar 25 10:16:06 2019 LOG_ERR Error binding device 13 [0529:0001] to connection 1, BIND_ERROR
System Messages from the VH Client
2019-03-25 10:41:25 INFO :In file ../src/msw/window.cpp at line 594: 'SetFocus' failed with error 0x00000057 (Falscher Parameter.).
.
OK what is in your auth.sh file?
auth.sh
<p>#!/bin/sh<br />
# Example script for performing basic user authorization for virtualhere<br />
# Also includes a simple password protection mechanism for accessing a device<br />
# Return 2 if the user needs to provide a password (or the password is incorrect) to use the device<br />
# Return 1 if the user is allowed to access this device<br />
# Return 0 if the user is not allowed to access this device<br />
# Parameters are passed in as:<br />
# $1 = VENDOR_ID<br />
# $2 = PRODUCT_ID<br />
# $3 = CLIENT_ID<br />
# $4 = CLIENT_IP<br />
# $5 = PRODUCT_SERIAL<br />
# $6 = PASSWORD<br />
# $7 = DEVPATH<br />
# $8 = NICKNAME<br />
# $9 = NUM_BINDINGS<br />
logger "Authorizing -> '$1' '$2' '$3' '$4' '$5' '$6' '$7' '$8' '$9'"<br />
# "mypassword" = "34819d7beeabb9260a5c854bc85b3e44" as an MD5 hash<br />
if [ "$6" == "34819d7beeabb9260a5c854bc85b3e44" ]; then<br />
echo "Password ok"<br />
else<br />
exit 2<br />
fi<br />
exit 1</p>
.
Ok that file works fine on my synology.
Im wondering if your synology doesnt have the /bin/sh interpreter. Try changing the top line to
#!/bin/bash
insteadchanging the interpreter to #
changing the interpreter to #!/bin/bash changed nothing
I started the whole thing again from "nothing" and now it is working.
I have no idea what it was. Maybe a line end was not Linux compliant.
fix the ==
this is the error
if [ "$6" == "34819d7beeabb9260a5c854bc85b3e44" ]; then <--
reemplace if [ "$6" = "34819d7beeabb9260a5c854bc85b3e44" ]; then <-- check the =. the original post have 2 = that why fail
.
OK great, thanks for letting me know.
Yes I wrote the script for bash (https://unix.stackexchange.com/questions/382003/what-are-the-difference…)
The double equals works on my synology so the shell must be different to yours. Here is my shell on the synology