Password protect Specific Usb device

4 posts / 0 new
Last post
Sida
Password protect Specific Usb device

Hi to all.
I am tryng to use ClientAuthorization for protect specific dongle (with defined vendor id)
I am using Virtualhere licensed server on raspberry pi2

I set ClientAuthorization=1 in config.ini

My problem is I am tryng to use example 2 script descrived here:
https://www.virtualhere.com/authorization

But in auth script i not see password request box for define pass and ask it to averyone user connected on the server.

Someone can help me?

Thanks a lot

Michael
.

Example 2 returns 1 if the user is allowed to use the device and 0 if they are not allowed.

You need to return 2 so that the client knows to ask for a password. The client will then send the password back to the server in the $PASSWORD$ field

Note in the first example the lines

# Return 2 if the user needs to provide a password (or the password is incorrect) to use the device
# Return 1 if the user is allowed to access this device
# Return 0 if the user is not allowed to access this device

You need to return specifically 2 to ask for the password

Sida
I tried with example 1

I tried with example 1

This is My config.ini:
It=
License=
ServerName=SiDa Electronics
DeviceNicknames=Dtc,0471,485d,112,A,0471,485d,114
PingInterval=2
ClientAuthorization=/root/auth.sh "$0471$" "$485d$" "$PASSWORD$"

This is my Auth.sh
#!/bin/bash
# Example script for performing basic user authorization for virtualhere
# Also includes a simple password protection mechanism for accessing a device
# Return 2 if the user needs to provide a password (or the password is incorrec$
# Return 1 if the user is allowed to access this device
# Return 0 if the user is not allowed to access this device
# Parameters are passed in as:
# $1 = PASSWORD

logger "Authorizing -> '$1'"
# "mypassword" = "34819d7beeabb9260a5c854bc85b3e44" as an MD5 hash
if [ "$6" == "34819d7beeabb9260a5c854bc85b3e44" ]; then
echo "Password ok"
logger "Authorized!"
exit 1
else
exit 2

fi

There is something wrong?
When I try to connect to 1 of my 2 devices connected there is a pop up asking password but if I insert nothing response, it ask me another time
The strange things is I specified product_id and client_id but sw ask me password for both devices connected

Can you help me?

Sida
Someone is able to find the

Someone is able to find the problem in my configuration?

Log in or register to post comments