OCCTL(8)
β¨ NAME β¨
occtl β the OpenConnect VPN server control tool, straight out of section 8 of the System Manager's Manual. π She's the little remote control for your VPN server and she serves.
πΈ SYNOPSIS πΈ
occtl [OPTIONS...] [COMMAND]
π¦ DESCRIPTION π¦
Okay so bestie, listen. This is a control tool, and its whole job is sending commands to ocserv. That's it. That's the vibe. π«Ά
When you call her with zero arguments, she goes full interactive mode β you get a command prompt and you just type each command in, one at a time, like texting your bestie. So cozy. β¨
OR, and hear me out, you can call her with the command already specified as a parameter. One and done, no small talk. And in that case, the tool's exit code will reflect whether the command actually executed successfully. Main character energy with receipts. π
π OPTIONS π
-s,--socket-file=FILEβ tell her where the server'socctlsocket file lives. You literally only need this if you're running multiple servers, so don't stress unless that's your life. π-j,--jsonβ output comes out JSON formatted. But bestie, this one only works with non-interactive output, e.g.occtl --json show users. No interactive JSON for you, sorry not sorry. π-n,--no-pagerβ no pager will be used over the output data. Raw and unfiltered, periodt.--debugβ gives you more verbose information in some commands. Basically the "tell me everything" button. π-h,--helpβ display usage information and exit. The classic.-v,--versionβ output version of program and exit. Vibe check on which build you're running. β
π₯ COMMANDS π₯
You can pass commands as arguments on the command line, OR you can type them interactively at the prompt when occtl is run without a command argument. Two paths, same destination, both iconic. π
π Informational commands
show statusβ display server-wide statistics: uptime, number of active sessions, number of banned IPs, and other aggregate counters. The whole dashboard, no cap. πshow usersβ list all currently connected users together with their session ID, assigned VPN IP address, and connection duration. Everyone's here, everyone's accounted for. π«Άshow user NAMEβ display detailed information about one specific connected user, including their assigned addresses, group, and traffic statistics. It's giving β¨personalizedβ¨.show id IDβ display detailed information about the connection identified by its numeric session ID. Numbers only, bestie. π’show iroutesβ list the internal routes that connected clients have advertised to the server via theirouteper-user/group configuration option. These routes are optionally redistributed to other clients whenexpose-iroutesis enabled. Very niche, very powerful. π§show eventsβ display a live log of connection and disconnection events. It's the group chat where every join and leave gets announced. π
π Session management
disconnect user NAMEβ terminate the active VPN connection of the named user. Important: the user's session cookie remains valid, so they can reconnect immediately using the same cookie (subject tocookie-timeout). It's a "brb" not a "goodbye". πdisconnect id IDβ terminate the VPN connection identified by its numeric session ID. The session ID is shown byshow usersandshow id. The cookie associated with that session remains valid. Same deal, different lookup key.terminate user NAMEβ disconnect the named user AND permanently invalidate all of their session cookies. They must re-authenticate from scratch on the next connection attempt. This one's serious, bestie. π₯terminate id IDβ disconnect the connection identified by its numeric session ID and invalidate the associated cookie. Both things. At once. Slay.terminate session SIDβ invalidate a session by its session ID (SID) without requiring an active connection. Use this to revoke a cookie held by a client that has already disconnected but whose session is still listed byshow sessions valid. So useful, obsessed. πshow sessions allβ list every known session, including sessions that are still in the authenticating state or have been disconnected but whose cookie has not yet expired. The full archive, no filtering.show sessions validβ list only the sessions whose cookie is still valid for reconnection. A session appears here after authentication completes and disappears when the cookie expires or is invalidated by aterminatecommand. The "still active" list. β¨show session SIDβ display detailed information about the session identified by its session ID (SID) string, as shown inshow sessions allorshow sessions valid. Single session, full tea. π
π§ IP ban management
unban ip IPβ remove the specified IP address from the ban list immediately, regardless of the remainingban-time. The address's accumulated ban points are also cleared. See themax-ban-score,ban-time, andban-reset-timedirectives inocserv.conf(8). Free them, bestie. ποΈshow ip bansβ list all IP addresses that are currently banned. An IP is banned when its accumulated score exceedsmax-ban-scoreinocserv.conf(8). The naughty list. πshow ip ban pointsβ list all IP addresses that have accumulated ban points, including those below the ban threshold. Useful for monitoring addresses that are approaching the ban limit. It's giving "we see you and we're watching". π
π Server control
reloadβ signal the server to re-read its configuration file. Equivalent to sendingSIGHUPto the mainocservprocess. Options marked as non-reloadable inocserv.conf(8)are not affected. Fresh config, same process, gorgeous.stop nowβ gracefully shut down the server. Active VPN sessions are terminated before the process exits. The polite goodbye, not the rage quit. πΈ
π EXIT STATUS π
0β successful program execution. We ate. π1β the operation failed or the command syntax was not valid. It happens, bestie. π
β IMPLEMENTATION NOTES β
This tool uses unix domain sockets to connect to ocserv. That's the whole magic trick. π©
π«Ά EXAMPLES π«Ά
The tool can be run interactively when run with no arguments. When arguments are given they are interpreted as commands. For example:
$ occtl show users
Any command line arguments to be used as options must precede the command (if any), as shown below. Order matters, bestie, do not test her.
$ occtl --json show users
π AUTHORS π
Written by Nikos Mavrogiannopoulos. Many people have contributed to it. We love a collaborative queen. π
π REPORTING BUGS π
Issue tracker: https://gitlab.com/openconnect/ocserv/-/issues
π COPYRIGHT π
Copyright (C) 2013-2024 Nikos Mavrogiannopoulos and others, all rights reserved. This program is released under the terms of the GNU General Public License, version 2.
πΈ SEE ALSO πΈ
And that's the whole page, bestie β this one's dated June 2026, it's the occtl(8) page from the System Manager's Manual, and it lives in the source tree with the rest of the ocserv family. π Go control that VPN, you've got this. β¨π¦π
π¦ where this page comes from
- epel 10: ocserv 1.5.0-2.el10_3 Β· GPL-2.0-or-later AND BSD-3-Clause AND MIT AND CC0-1.0
- fedora 44: ocserv 1.5.0-2.fc44 Β· GPL-2.0-or-later AND BSD-3-Clause AND MIT AND CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms