How to disconnect a single client connection in OpenVPN?

Would like to forcefully kick a specific user connection.

OS is Ubuntu 16, OVPN Server is OpenVPN 2.3.10

I can see them connected in /etc/openvpn/openvpn-status.log which lists out current client status. And their persistent connection pool is saved to /etc/openvpn/ipp.txt

I can kick all users by simply cycling the openvpn daemon service openvpn restart however I want to kick ONE single user.

I've tried openvpn --help and man openvpn as well as searched google but not seeing anything.

OS is Ubuntu 16, Server is OpenVPN 2.3.10


Solution 1:

Doing this requires some preparation ahead of time. Specifically you need to enable the Management port (--management IP port). With the management port enabled you can connect to that management port using telnet/netcat and then you can issue commands to disconnect a session (eg kill client-name).

See this page for more about the usage of that interface.

  • https://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html