listen
Start a listener to accept pairing requests.
Usage
connecto listen [OPTIONS]
Description
The listen command starts a pairing listener on the current machine. It:
- Advertises the device via mDNS on the local network
- Waits for incoming pairing requests on TCP port 8099
- Accepts public keys and adds them to
~/.ssh/authorized_keys - Exits after successful pairing (unless
--continuousis used)
Options
| Option | Description |
|---|---|
-p, --port <PORT> | Port to listen on (default: 8099) |
-n, --name <NAME> | Device name to advertise (default: hostname) |
--verify | Require interactive approval of a verification code before installing a key |
-c, --continuous | Keep listening after successful pairing |
--adhoc | Create an ad-hoc WiFi network (bypasses router, for isolated networks) |
--bluetooth | Enable Bluetooth Low Energy advertising (Linux only; requires a build with the bluetooth feature) |
Examples
Basic usage
connecto listen
Output:
CONNECTO LISTENER
→ Device name: mydesktop
→ Port: 8099
Local IP addresses:
• 192.168.1.55
✓ mDNS service registered - device is now discoverable
Listening for pairing requests on port 8099...
With verification (recommended on shared networks)
connecto listen --verify
Each pairing request must be approved before anything is installed:
Pairing approval required
• Device: my-laptop
• Key comment: user@my-laptop
• Fingerprint: SHA256:mTiqtUQvo0mB/zDzQbxahaBBq+KJ62pV8ECXptWqzLg
• Code: 627765
Compare the code with the one shown on the pairing device.
Approve this pairing? [y/N]
The code is derived from the received key material on both sides independently, so matching codes rule out a swapped key — see Security.
Custom name and port
connecto listen --name workstation --port 9000
Continuous mode
Keep listening for multiple pairings:
connecto listen --continuous
Ad-hoc WiFi network
On networks with client isolation (devices can’t see each other), --adhoc
creates a direct device-to-device WiFi network:
connecto listen --adhoc
Platform notes:
- macOS: modern macOS (14.4 and later) cannot create ad-hoc networks from
the command line at all — Apple turned the
airportutility into a no-op. Connecto detects this and fails fast with instructions for creating the network manually (Option-click the WiFi menu → Create Network). - Linux: uses
nmcli(with aniwfallback). - Windows: uses
netsh wlan hostednetwork(requires Administrator); the network password is printed.
Your previous WiFi network and DHCP configuration are restored when the listener exits, including on Ctrl+C.
What happens during pairing
- Client connects and the two sides negotiate a protocol version
- Client sends its public key
- The listener validates the key and derives its fingerprint and 6-digit verification code
- With
--verify, the listener prompts for approval — nothing is installed if you decline. Without--verify, the key is installed automatically and the fingerprint/code of what was installed are printed. - Listener adds the key to
~/.ssh/authorized_keysand sends back its username - Listener exits (or continues if
--continuous)
If the final confirmation cannot be delivered after the key was installed,
the listener rolls the installation back. Probe connections (e.g. from
connecto scan) do not consume the one-shot session — the listener keeps
waiting until a pairing actually completes.
See Protocol for the full message flow.
VPN/Cross-Subnet Detection
When a pairing comes from a different subnet, the listener displays a helpful message:
✓ Successfully paired with mac-laptop!
→ They can now SSH to this machine.
VPN/Cross-subnet connection detected!
→ Tell mac-laptop to save your subnet for future scans:
connecto config add-subnet 10.0.1.0/24
Security notes
- Without
--verify, any device on the network that completes the handshake gets its key installed. Use--verifyon any network with untrusted devices — see Security. - Only run
listenwhen you intend to pair - The listener only accepts SSH public keys (not arbitrary data)
- Stop the listener when done to prevent unwanted pairings
Exit status
Like all connecto commands, listen exits non-zero when it fails (e.g. the
port cannot be bound), so it is safe to use in scripts.