rtty:在任何地方通過 Web 訪問您的終端
rtty
它由客戶端和 ofollow,noindex" target="_blank">服務端 組成。客戶端採用純C實現。 服務端 採用GO語言實現,前端介面採用 iview 和 vue 實現。
你可以在任何地方通過Web訪問你的終端。通過裝置ID(如果不設定則使用裝置的MAC地址)來區分你的不同的終端。
rtty非常適合遠端維護你的或者你公司的部署在全球各地的成千上萬的Linux裝置。
特性
- 部署簡單,使用方便
- 根據裝置ID訪問不同的裝置
- 提供dashboard,直觀的展示線上裝置
- 基於 xtermjs/xterm.js" rel="nofollow,noindex" target="_blank">Xterm.js 的全功能終端
- 支援使用 lrzsz 傳輸檔案
- 支援SSL: openssl, mbedtls, CyaSSl(wolfssl)
- 支援遠端執行命令
- 客戶端非常小,適合嵌入式Linux: rtty(20.1K) + libev(48.5K) + libuwsc(24.4K) + libwolfssl(595.9K) = 688.9K
客戶端依賴
- libev - 高效能的事件迴圈庫
- libuwsc - 一個輕量的針對嵌入式Linux的基於libev的Socket/">WebSocket客戶端C庫。
- ARMmbed/mbedtls" rel="nofollow,noindex" target="_blank">mbedtls(polarssl) 、 CyaSSl(wolfssl) 或者 openssl - 如果你需要支援SSL
部署服務端
如何安裝和執行rtty客戶端
針對Linux發行版:Ubuntu, Debian, ArchLinux, Centos
安裝
wget -qO- https://raw.githubusercontent.com/zhaojh329/rtty/master/tools/install.sh | sudo bash
檢視命令列選項
Usage: rtty [option] -i ifname# Network interface name - Using the MAC address of the interface as the device ID -I id# Set an ID for the device(Maximum 63 bytes, valid character:letters and numbers and underlines and short lines) - If set, it will cover the MAC address(if you have specify the ifname) -h host# Server host -p port# Server port -a# Auto reconnect to the server -v# verbose -d# Adding a description to the device(Maximum 126 bytes) -s# SSL on -k keepalive # keep alive in seconds for this client. Defaults to 5 -V# Show version -D# Run in the background
執行RTTY(將下面的引數替換為你自己的引數)
sudo rtty -I 'My-device-ID' -h 'your-server' -p 5912 -a -v -s -d 'My Device Description'
嵌入式Linux平臺
你需要自行交叉編譯
如何在OpenWRT中使用
如何使用
使用你的Web瀏覽器訪問你的伺服器: https://your-server-host:5912
,然後點選連線按鈕。
你可以非常方便的將RTTY嵌入到你現有的平臺: https://your-server-host:5912/#/?id=your-id
自動登入: https://your-server:5912/#/?id=device-id&username=device-username&password=device-password
遠端執行命令
Shell
curl -k https://your-server:5912/cmd -d '{"devid":"test","username":"test","password":"123456","cmd":"ls","params":["/"],"env":{}}' {"Err":0,"msg":"","code":0,"stdout":"bin\ndev\netc\nlib\nmnt\noverlay\nproc\nrom\nroot\nsbin\nsys\ntmp\nusr\nvar\nwww\n","stderr":""}
Jquery
var data = {devid: 'test', username: 'test', password: '123456', cmd: 'ls', params: ['/'], env: {}}; $.post('https://your-server:5912/cmd', JSON.stringify(data), function(r) {console.log(r)});
Axios
var data = {devid: 'test', username: 'test', password: '123456', cmd: 'ls', params: ['/'], env: {}}; axios.post('https://your-server:5912/cmd', JSON.stringify(data)).then(function (response) { console.log(response.data); }).catch(function (error) { console.log(error); });
捐贈
貢獻程式碼
如果你想幫助 rtty 變得更好,請參考 CONTRIBUTING_ZH.md 。
技術交流
QQ群:153530783