-
Notifications
You must be signed in to change notification settings - Fork 23
[Daemon] telnet server
The plain text telnet server provide access to app commands via rudimentary client software such as telnet
, netcat
,
and HyperTerminal
.
The server is capable of operating on both TCP and UDP. Due to the simplicity of underlying protocol, data are exchanged in plain text between client software and this server daemon. See tips below.
- Construct the following JSON object and place it under JSON key
PlainSocketDaemon
in configuration file:
Property | Type | Meaning | Default value |
---|---|---|---|
TCPPort | integer | TCP port number to listen to. Use 0 to disable the TCP listener. | (This is a mandatory property without a default value) |
UDPPort | integer | UDP port number to listen on. Use 0 to disable the UDP listener. | (This is a mandatory property without a default value) |
Address | string | The address network to listen on. | "0.0.0.0" - listen on all network interfaces. |
PerIPLimit | integer | Maximum number of times a client (identified by IP) may communicate with the server in a second. | 2 - good enough for personal use |
- Follow command processor to construct configuration for
JSON key
PlainSocketFilters
.
Here is a minimal setup example:
{ ... "PlainSocketDaemon": { "TCPPort": 53, "UDPPort": 53 }, "PlainSocketFilters": { "PINAndShortcuts": { "Passwords": ["VerySecretPassword"], "Shortcuts": { "watsup": ".eruntime", "EmergencyStop": ".estop", "EmergencyLock": ".elock" } }, "TranslateSequences": { "Sequences": [ ["#/", "|"] ] }, "LintText": { "CompressSpaces": false, "CompressToSingleLine": false, "KeepVisible7BitCharOnly": false, "MaxLength": 4096, "TrimSpaces": false }, "NotifyViaEmail": { "Recipients": ["[email protected]"] } }, ... }
Tell laitos to run chat bot daemon in the command line:
sudo ./laitos -config <CONFIG FILE> -daemons ...,plainsocket,...
Use any TCP/UDP connection tool such as netcat
(also called nc
), telnet
(TCP only), or HyperTerminal
(TCP only)
to connect to plain text daemon:
nc <laitos-server-IP> <TCPPort>
And type an app command (the example uses a system shell command to retrieve system uptime):
VerySecretPassword .s uptime
11:09am up 2:58, 3 users, load average: 0.23, 0.29, 0.27 (the response)
The UDP socket functions in similar way (the -u
switch tells netcat
to make UDP connection):
nc -u <laitos-server-IP> <UDPPort>
And type app commands similar to the TCP example.
- The plain text daemon helps to invoke app commands in the unlikely event of losing access to all other daemons. The primitive nature of the protocol opens up possibility of eavesdropping, consider using one-time password in place of password.
- The size of app command and command response are limited to roughly 1200 characters each when using UDP.
- When using Telnet client program on Linux and Unix, the client program displays (echos) the keyboard input automatically.
However on Windows the Telnet program does not display input automatically, to work around it, type
Ctrl+]
after establishing telnet connection, and then typeset localecho
to enable input display.
Table of Contents
- Home
- Get started
- Component list
- Tips for running on public cloud
- Tips for using apps over satellite
- laitos terminal
Daemon Components
- DNS server
- Mail server
- Web server
- Web proxy server
- Telnet server
- Telegram chat-bot
- Simple IP services server
- SNMP server
- System maintenance
- Phone home telemetry
Web Service Components
- Twilio telephone/SMS hook
- Microsoft chat bot hook
- The Things Network LORA tracker integration
- Recurring commands
- App command form
- Simple app command execution API
- GitLab browser
- Temporary file storage
- Simple web proxy
- Desktop on a page (virtual machine)
- Read telemetry records
- Program health report
- System process explorer
- Prometheus metrics exporter
- HTTP request inspector
- HTTP request logger
Apps