Sign inSign up

strawhatboy/motionpro-vpn-client

By strawhatboy

•Updated 10 months ago

Array Networks MotionPro Linux client on Ubuntu 22.04 in container served as ssh proxy.

Image
Networking
0

255

strawhatboy/motionpro-vpn-client repository overview

⁠motionpro-vpn-client

This image installs Array Networks MotionPro Linux client on Ubuntu 22.04 and enables OpenSSH access (optionally with root login) for convenience when running as a container.

⁠Run

Basic run (SSH on 22, random root password generated and printed in logs):

docker run -d --name motionpro --privileged --cap-add=NET_ADMIN -p 2222:22 strawhatboy/motionpro-vpn-client:0.0.1

Then you will be able to use this container as an ssh proxy for the VPN.

Why --privileged? Some VPN operations require elevated kernel capabilities beyond NET_ADMIN alone (e.g., TUN/TAP handling, iptables/routing, device nodes). Using --privileged ensures MotionPro can establish the tunnel reliably. Consider the security implications and restrict use to trusted environments.

Customize SSH behavior with environment variables:

  • SSH_PORT: Port for sshd inside the container (default: 22)
  • PASSWORD_AUTH: yes | no (default: yes)
  • ROOT_PASSWORD: Root password for password auth; if omitted and PASSWORD_AUTH=yes, a random one is generated and printed
  • AUTHORIZED_KEYS: One or more public keys. Separate multiple lines with literal newlines or use a file mount

Note: Root login is enabled inside this container for convenience (PermitRootLogin=yes). Prefer key-based auth for security-sensitive use.

⁠Launch VPN automatically (vpn_cmdline.sh)

Set these environment variables to have the container start the MotionPro VPN via vpn_cmdline.sh:

  • VPN_HOST: VPN gateway hostname
  • VPN_USER: VPN username
  • VPN_PASS: VPN password

Example:

docker run -d --name motionpro \
  --privileged --cap-add=NET_ADMIN \
  -e VPN_HOST='vpn.example.com' \
  -e VPN_USER='alice' \
  -e VPN_PASS='s3cret' \
  -p 2222:22 strawhatboy/motionpro-vpn-client:0.0.1

When VPN_* variables are set, the entrypoint will cd to /opt/MotionPro and run:

./vpn_cmdline.sh -h $VPN_HOST -u $VPN_USER -p $VPN_PASS -q

Logs:

docker exec motionpro tail -n 200 /var/log/motionpro_vpn.log

If VPN_* variables are not provided, the entrypoint will still start /usr/bin/vpnd and log to /var/log/vpnd.log. When VPN_* are present, it starts vpnd then runs vpn_cmdline.sh.

Examples:

  1. Disable password auth and use keys only:
docker run -d --name motionpro \
  --privileged --cap-add=NET_ADMIN \
  -e PASSWORD_AUTH=no \
  -e AUTHORIZED_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
  -p 2222:22 strawhatboy/motionpro-vpn-client:0.0.1
  1. Use a fixed root password and custom port:
docker run -d --name motionpro \
  --privileged --cap-add=NET_ADMIN \
  -e ROOT_PASSWORD='changeme' \
  -e SSH_PORT=2222 \
  -p 2222:2222 strawhatboy/motionpro-vpn-client:0.0.1

⁠Notes

  • For security, prefer key-based auth and disable password auth in environments beyond local development.
  • --privileged increases container privileges significantly; use only when necessary and in trusted environments.
  • The container runs sshd in the foreground via an entrypoint script.
  • MotionPro client was installed via unattended script per vendor link in the Dockerfile.
  • Exposes port 22. Map to host with -p HOSTPORT:22.

Tag summary

Content type

Image

Digest

sha256:1ec02e755…

Size

192.5 MB

Last updated

10 months ago

docker pull strawhatboy/motionpro-vpn-client:0.0.1