Recommended in this issue is a tool to access the device terminal through the Web — rtty.
rtty consists of a client and a server. The client is implemented in pure C, the server is implemented in GO language, and the front-end interface is implemented in vue. With rtty, you can access the terminal of your device through the Web from anywhere, and distinguish your different devices by device ID. rtty is great for maintaining Linux devices remotely.
class=”pgc-h-arrow-right” data-track=”14″>
- Client C language implementation, very small, suitable for embedded Linux
SSL not supported: rtty(32K) + libev(56K)
SSL: + libmbedtls(88K) + libmbedcrypto(241K) + libmbedx509(48k)
- Remote batch command execution
- Support SSL: openssl, mbedtls, CyaSSl(wolfssl)
- SSL two-way authentication (mTLS)
- very convenient to upload and download files
- Access different devices based on device ID
- Support HTTP proxy – Access your device’s Web
- Full-function terminal based on Xterm.js
- Easy to deploy and use

class=”pgc-h-arrow-right” data-track=”107″> Client dependencies
- libev – High performance event loop library
- mbedtls(polarssl), CyaSSl(wolfssl), or openssl – if you need to support SSL
Deploy server
1 Download the compiled binary from the Release page or compile it yourself
git clone https://github.com/zhaojh329/rttys
cd ui
npm install
npm run build
cd ..
./build.sh linux amd64
2 authentication
- Token
Generate a token:
$ rttys token
Please set a password:******
Your token is: 34762d07637276694b938d23f10d7164
Use token:
$rttys -t 34762d07637276694b938d23f10d7164
- SSL two-way authentication (mTLS)
You can enable mTLS by specifying the device CA store in the configuration file (valid file) or in the CLI (parameter ssl-cacert). Devices that do not have a valid CA in storage will be disconnected at the TLS handshake.
3 Run service
Move the rttys executable to /usr/local/bin/
sudo mv rttys /usr/local/bin/
Copy the configuration file to /etc/rttys/
sudo mkdir /etc/rttys
sudo cp rttys.conf /etc/rttys/
< p data – track = “44” > create a systemd unit file: / etc/systemd/system/rttys. Service < / p >
[Unit]
Description=rttys
After=network.target
[Service]
ExecStart=/usr/local/bin/rttys run -c /etc/rttys/rttys.conf
TimeoutStopSec=5s
[Install]
WantedBy=multi-user.target
To start the service for the first time, perform the usual systemctl operation
sudo systemctl daemon-reload
sudo systemctl enable rttys
sudo systemctl start rttys
The service can be stopped by
sudo systemctl stop rttys
4 Database preparation (Sqlite, MySql, or Mariadb)
Log in to the database console as root on the database instance
mysql -u root -p
Create the database user that will be used by Rttys, authenticated by password. This example uses “rttys” as the password. Please use the security password
for your instance
CREATE USER 'rttys' IDENTIFIED BY 'rttys';
Create the database using the UTF-8 character set and collation rules. Make sure to use the utf8mb4 character set instead of utf8, as the former supports all Unicode characters (including emojis) beyond the basic multilingual plane. In addition, choose a sorting rule based on what you expect. If in doubt, use unicode_ci or general_ci
CREATE DATABASE rttys CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_unicode_ci';
Grant all permissions on the database to the database user created above
GRANT ALL PRIVILEGES ON rttys.* TO 'rttys';
FLUSH PRIVILEGES;
Install rtty (for Linux distributions)
Install dependencies
sudo apt install -y libev-dev libssl-dev # Ubuntu, Debian
sudo pacman -S --noconfirm libev openssl # ArchLinux
sudo yum install -y libev-devel openssl-devel # Centos
Clone rtty code
git clone --recursive https://github.com/zhaojh329/rtty.git
compile
cd rtty & & mkdir build & & cd build
cmake .. & & make install
Run rtty
Replace the following parameters with your own
sudo rtty -I 'My-device-ID' -h 'your-server' -p 5912 -a -v -d 'My Device Description'
If your rttys is configured with a token, add the following parameters (replace the tokens below with your own generation)
-t 34762d07637276694b938d23f10d7164
Access
through a browser
Access your server using a Web browser:
http://your-server-host:5913, then click the Connect button.
or directly connect to the device without Web login (device whitelist needs to be configured on the server)
http://your-server-host:5913/connect/devid1
http://your-server-host:5913/connect/devid2
Transfer files from local to remote device
rtty -R
Transfer file from remote device to local
rtty -S test.txt
—END—
Open source protocol: MIT