[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openvpn-devel
Subject:    [Openvpn-devel] small passwordstore and openvpn cooperation script
From:       Craig Comstock <craig () unreasonablefarm ! org>
Date:       2020-01-17 22:02:24
Message-ID: 20200117220224.GA33346 () other
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hello,

I have wanted to integrate my use of password store (https://www.passwordstore.org/) \
with openvpn for a while but never quite figured it out. After a conversation on \
#openvpn I discovered the Management Interface and was able to rather quickly write \
the script I wanted.

I will be fixing it up for ease of use but the basics here work:

```
sudo /usr/sbin/openvpn --management localhost 7505 \
--management-query-passwords \
--management-hold \
--config $1 >~/.openvpn.log &

MGMT_IFACE=/dev/tcp/localhost/7505

until echo "" > $MGMT_IFACE
do
  sleep 1
done

exec 3> $MGMT_IFACE
echo "hold release" >&3
echo "password Auth '$(pass $2 | head -n1)'" >&3
echo "username Auth $(pass $2 | head -n2 | tail -n1)" >&3
```

$1 is my .ovpn file path
$2 is the path used for pass to retrieve my username/password.
for pass typically password is first line, username is second line in this case.

Thanks,
Craig Comstock | CFEngineer/digger at Northern.tech | personal: unreasonablefarm.org


["signature.asc" (application/pgp-signature)]



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic