Skip to main content

Use the CLI locally

WireGuard​

The easiest way to interact with Ludus is over WireGuard which allows the ludus CLI to talk to the API server and allows you to access VMs directly - via SSH, RDP, KasmVNC, etc. To get the WireGuard configuration file for your user, run the user wireguard command. Admins can get WireGuard configurations for other users with the user wireguard --user <UserID> command.

Once connected, the ludus client's default url (https://198.51.100.1:8080) will work for all future commands.

ludus user wireguard | tee ludus.conf
[Interface]
PrivateKey = KBxrT+PFLClI+uJo9a6XLm/b23vbqL5KmNQ5Ac6uwGI=
Address = 198.51.100.2/32

[Peer]
PublicKey = 5nlDO6gtqVXI89xQNkd2c2L0US7RnPinbAlfiyWHHBM=
Endpoint = 10.2.99.240:51820
AllowedIPs = 10.2.0.0/16, 198.51.100.1/32
PersistentKeepalive = 25

On your local machine, import this WireGuard configuration (ludus.conf) into the WireGuard GUI client or on the command line with wg-quick and connect. wg setconf is not supported by this configuration. Now you can directly interact with range VMs as if you were on the same network.

Setting up the Ludus client locally​

The same installer script used to install the server will install the client on a Linux machine.

# All-in-one command
curl -s https://ludus.cloud/install | bash

# If you want to check out the install script
curl https://ludus.cloud/install > install.sh
cat install.sh
chmod +x install.sh
./install.sh

Set the API Key​

Using the key from the previous step, run ludus apikey and provide the user API key.

ludus apikey
[INFO] Enter your Ludus API Key for https://198.51.100.1:8080:
JD._7Gx2T5kTUSD%uTWZ*lFi=Os6MpFR^OrG+yT94Xt
[INFO] Ludus API key set successfully
tip

On headless Linux systems or Linux systems without a keyring, set the LUDUS_API_KEY environment variable instead

export LUDUS_API_KEY='JD._7Gx2T5kTUSD%uTWZ*lFi=Os6MpFR^OrG+yT94Xt'

With the API key set, all user commands are available!

You can manage your range, enter/exit testing mode, and more from your local machine.

ludus -h will show you all the options.