Giter Site home page Giter Site logo

zhaojh329 / rtty Goto Github PK

View Code? Open in Web Editor NEW
3.6K 97.0 484.0 6.46 MB

🐛 Access your terminal from anywhere via the web.

License: MIT License

CMake 2.63% C 95.81% Shell 1.56%
webshell webssh remote-shell remote-control remote-console remote-debug tty nat http-proxy proxy

rtty's Introduction

rtty(中文)

This project is officially supported by GL.iNet.

license PRs Welcome Issue Welcome Release Version Build Status visitors

It is composed of a client and a server. The client is written in pure C. The server is written in go language and the front-end is written in Vue.

You can access your device's terminal from anywhere via the web. Distinguish your different device by device ID.

rtty is very suitable for remote maintenance your or your company's thousands of Linux devices deployed around the world.

Features

  • The client is writen in C language, very small, suitable for embedded Linux
    • No SSL: rtty(32K) + libev(56K)
    • Support SSL: + libmbedtls(88K) + libmbedcrypto(241K) + libmbedx509(48k)
  • Execute command remotely in a batch of devices
  • SSL support: openssl, mbedtls, CyaSSl(wolfssl)
  • mTLS
  • Very convenient to upload and download files
  • Access different devices based on device ID
  • Support HTTP Proxy - Access your device's Web
  • Fully-featured terminal based on Xterm.js
  • Simple to deployment and easy to use

Who's using rtty

Dependencies of the Client side

How to install rtty

For Linux distribution

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 the code of rtty

git clone --recursive https://github.com/zhaojh329/rtty.git

Build

cd rtty && mkdir build && cd build
cmake .. && make install

For Buildroot

Select rtty in menuconfig and compile it

Target packages  --->
    Shell and utilities  --->
        [*] rtty

Command-line Options

Usage: rtty [option]
    -I, --id=string          Set an ID for the device(Maximum 63 bytes, valid
                             character:letter, number, underline and short line)
    -h, --host=string        Server's host or ipaddr(Default is localhost)
    -p, --port=number        Server port(Default is 5912)
    -d, --description=string Add a description to the device(Maximum 126 bytes)
    -a                       Auto reconnect to the server
    -s                       SSL on
    -C, --cacert             CA certificate to verify peer against
    -x, --insecure           Allow insecure server connections when using SSL
    -c, --cert               Certificate file to use"
    -k, --key                Private key file to use"
    -D                       Run in the background
    -t, --token=string       Authorization token
    -f username              Skip a second login authentication. See man login(1) about the details
    -R                       Receive file
    -S file                  Send file
    -v, --verbose            verbose
    -V, --version            Show version
    --help                   Show usage

How to run rtty

Replace the following parameters with your own parameters

sudo rtty -I 'My-device-ID' -h 'your-server' -p 5912 -a -v -d 'My Device Description'

If your rttys is configured with mTLS enabled (device key and certificate required), add the following parameters(Replace the following with valid paths to your own)

-k /etc/ssl/private/abc.pem -c /etc/ssl/certs/abc.pem

You can generate them e.g. via openssl tool openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp521r1 -keyout /tmp/key.pem -out /tmp/cert.pem -days 18262 -nodes -subj "/C=CZ/O=Acme Inc./OU=ACME/CN=ACME-DEV-123"

If your rttys is configured with a token, add the following parameter(Replace the following token with your own)

-t 34762d07637276694b938d23f10d7164

Usage

Use your web browser to access your server: http://your-server-host:5913, then click the connection button

connect devices with no web login required(you need to configure the device white list on the server)

http://your-server-host:5913/connect/devid1

http://your-server-host:5913/connect/devid2

Transfer file

Transfer file from local to remote device

rtty -R

Transfer file from remote device to the local

rtty -S test.txt

Contributing

If you would like to help making rtty better, see the CONTRIBUTING.md file.

rtty's People

Contributors

axlrose avatar ffontaine avatar hauke avatar jiri-novotny avatar jiuaichiyu avatar leenzhu avatar richard611 avatar zhaojh329 avatar zjh809 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtty's Issues

daemon.err rtty: tcp_connect failed: Try again

Hi.

I make router reboot every midnight. Rtty fails to start after rebooting every time.
Here is a log from logread.

Mon Nov 19 03:50:46 2018 daemon.notice netifd: Network device 'pppoe-wan' link is up
Mon Nov 19 03:50:46 2018 daemon.notice netifd: Interface 'wan' is now up
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: reading /tmp/resolv.conf.auto
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain test
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain onion
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain localhost
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain local
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain invalid
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain bind
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain lan
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 163.139.21.197#53
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 163.139.230.168#53
Mon Nov 19 03:50:46 2018 user.notice firewall: Reloading firewall due to ifup of wan (pppoe-wan)
Mon Nov 19 03:50:46 2018 daemon.notice netifd: Interface 'wan6' is now up
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: reading /tmp/resolv.conf.auto
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain test
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain onion
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain localhost
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain local
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain invalid
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain bind
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using local addresses only for domain lan
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 163.139.21.197#53
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 163.139.230.168#53
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 2001:a7ff:5f01::a#53
Mon Nov 19 03:50:46 2018 daemon.info dnsmasq[2248]: using nameserver 2001:a7ff:5f01:1::a#53
Mon Nov 19 03:50:46 2018 user.notice firewall: Reloading firewall due to ifup of wan6 (eth0)
Mon Nov 19 03:50:48 2018 daemon.err rtty: (uwsc.c:563) tcp_connect failed: Try again
Mon Nov 19 03:50:49 2018 daemon.err rtty: (main.c:279) onerror:1: read error

Environment: pcengine apu2c4, OpenWrt SNAPSHOT, r8210-031c31ccdb

rtty一直断开重连

日志:
Thu Feb 6 16:44:46 2020 daemon.err rtty: (rtty.c:454) Inactive too long time
Thu Feb 6 16:44:47 2020 daemon.err rtty: (rtty.c:448) rtty reconnecting...

Aliasing MAC Addresses

Tottally newbie request, but how about giving the option of setting up a list of "Aliases" for your preferred MAC Addresses.

I took a peek in your code and might be implemented after the instantiation of the Devices Class and adding a little more data to the return of handle_list.

Maybe a method called add_alias that prefills a mac_aliases dict and also the devs dict in Devices class?

The main goal is to load the interface and click your "Aliased" MAC address and start the session.

rtty client make error on CentsOS 6.8

when run ./install.sh, some errors occur like:

......
Receiving objects: 100% (2182/2182), 6.36 MiB | 14 KiB/s, done.
Resolving deltas: 100% (1378/1378), done.
-- The C compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find Libev (missing: LIBEV_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLibev.cmake:25 (find_package_handle_standard_args)
src/CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!
See also "/tmp/rtty-build/libuwsc/CMakeFiles/CMakeOutput.log".

error v6.2.0

rtty
(main.c:629) libuwsc version 3.0.3
(main.c:630) rtty version 6.2.0
(uwsc.c:229) verify Sec-WebSocket-Accept failed
(main.c:469) onerror:2: Invalid header
(uwsc.c:229) verify Sec-WebSocket-Accept failed
(main.c:469) onerror:2: Invalid header

rttys
2018/09/25 21:46:29 go version: go1.10.1 linux/amd64
2018/09/25 21:46:29 rttys version: 2.4.0
2018/09/25 21:46:29 Listen on: 5912 SSL off
2018/09/25 21:46:39 New device:id('My-device-ID'), description('My Device Description')
2018/09/25 21:46:39 Dead device:id('My-device-ID'), description('My Device Description')

tested on rtty-openssl or rtty-nossl same error message.

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='18.06'
DISTRIB_REVISION='r7324-05606de1aa'
DISTRIB_TARGET='ar71xx/generic'
DISTRIB_ARCH='mips_24kc'

Right click on Ubuntu desktop

hi

I tried the web client from Mac and it works fine but on Ubuntu desktop (Gnome) right click on the mouse brings up the browser's context menu (Inspect Element etc)

I'm using Ubuntu on a Mac but the mouse is a standard USB mouse

上传文件拓展名问题

上传文件到服务器,如果是png文件上传后不包含 .png拓展名,只有文件文件名
下载时如果没有拓展名,会自动添加拓展名名txt

remote command example

The Features list remote command execution. How do we execute commands remotely without a terminal session? How do we see the output? And is it possible to execute the same command across all connected clients?

Final question is what if we execute something that produces very long output (that could go on for a minute or so) and what if we execute a command that launches vim or some other interactive process. I mean all outside of terminal session. Trying to wrap my mind around remote commands idea.

WSS support

When I use rtty under Windows Chrome, I got such error:

vendor.46246f9d23c64a438174.js:1 Mixed Content: The page at 'https://mydomain:8443/?t=1520435728' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://mydomain:8443/ws?devid=myid'. This request has been blocked; this endpoint must be available over WSS.

rtty client crash when close RTTYS first.

reproduct steps:

  1. start RTTYS
  2. start rtty
  3. open web page and connect
  4. close RTTYS
  5. rtty crashed.

avl_remove_all_elements() invokes del_tty_session(), but del_tty_session() invokes avl_delete() inside.
while comment of avl_remove_all_elements in libubox/avl.h says:

Do NOT call avl_delete() on the elements within the loop(avl_remove_all_elements),

static void uwsc_onclose(struct uwsc_client *cl)
{
    struct tty_session *tty, *tmp;

    ULOG_ERR("onclose\n");

    if (pkt) {
        rtty_packet_free(pkt);
        pkt = NULL;
    }

    avl_remove_all_elements(&tty_sessions, tty, avl, tmp)
        del_tty_session(tty);

    cl->send(cl, NULL, 0, WEBSOCKET_OP_CLOSE);
    cl->free(cl);

    if (auto_reconnect)
        uloop_timeout_set(&reconnect_timer, RECONNECT_INTERVAL * 1000);
    else
        uloop_end();
}

static void del_tty_session(struct tty_session *tty)
{
    avl_delete(&tty_sessions, &tty->avl);
    uloop_timeout_cancel(&tty->timer);
    uloop_process_delete(&tty->up);
    ustream_free(&tty->sfd.stream);
    close(tty->pty);
    kill(tty->pid, SIGTERM);
    waitpid(tty->pid, NULL, 0);
    close(tty->upfile.fd);
    ULOG_INFO("Del session:%s\n", tty->sid);
    free(tty);

    if (avl_is_empty(&tty_sessions)) {
        rtty_packet_free(pkt);
        pkt = NULL;
    }
}

SegFault in latest main.c::change_winsize

The function main.c::change_winsize segfault, caused by NULL tty.

This is easily reproducible by symlink /bin/login to a shell script that exits immediately without doing anything.

The underlaying sequence appears to be

  1. SIGCHLD queued,
  2. The window size message queued
  3. SIGCHLD processed to destroy the SID
  4. change_winsize is called with the destroyed SID.
  5. tty pointer thus is null

rtty session corruption at file transmission

Hey,

i have rtty on an openwrt device. I transmitted a bigger file (~16mb) but cancelled the transmission.
This broke the rtty service, and the terminal output was totally corrupted/garbage in rttys. After a reboot, the device also didn't appeared anymore in rttys. (the service still ran on the device)
Only a clean firmware reflash helped. Do you know more about this behaviour?

Cheers,

client 段错误

(main.c:562) rtty version 5.1.0
(main.c:415) onopen
(main.c:149) New session:114d60eea1186ec3850bd841e6f665a5
(main.c:422) onerror:1
(main.c:429) onclose
(main.c:73) Del session:114d60eea1186ec3850bd841e6f665a5
Segmentation fault
版本 client openwrt 5.10 server 2.1.1
server 部署在阿里云上,client openwrt 上, 当从页面登录 cat 一个较大文件(2M 左右)出现此问题,必现。加上-P 10 后报错信息如下:
root@FlexThinEdge:~# rtty -h 4xx.xx.xx -p 5913 -a -I 000BABF59BA4 -v -P 10
(main.c:562) rtty version 5.1.0

(main.c:415) onopen

(main.c:149) New session:12debde0f3545fc991dd9d9c2b2c1b2a

(uwsc.c:468) Ping server, no response
:Resource temporarily unavailable

rtty如何离线安装

现在rtty是在线安装
但是改如何离线安装呢?
1.下载依赖包
2.执行什么命令编译这些依赖包
3.执行什么命令编译生成客户端

附上CentOS-7客户端开机自启脚本
vi /lib/systemd/system/rttyc.service

[Unit]
Description=rttyc
After=network.target network-online.target syslog.target
Wants=network.target network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/rtty -I 'fedora' -h '192.168.99.214' -p 5912 -a -v -t b7dd7ccb255a4a84562c76abae0a232b

[Install]
WantedBy=multi-user.target
systemctl start rttyc
systemctl enable rttyc

when rtty connected, and a web tty session established, then close RTTYS first, rtty crashed.

reproduct steps:

  1. start RTTYS
  2. start rtty
  3. open web page and connect
  4. close RTTYS
  5. rtty crashed.

avl_remove_all_elements() invokes del_tty_session(), but del_tty_session() invokes avl_delete() inside.
while comment of avl_remove_all_elements in libubox/avl.h says:

Do NOT call avl_delete() on the elements within the loop(avl_remove_all_elements),

static void uwsc_onclose(struct uwsc_client *cl)
{
    struct tty_session *tty, *tmp;

    ULOG_ERR("onclose\n");

    if (pkt) {
        rtty_packet_free(pkt);
        pkt = NULL;
    }

    avl_remove_all_elements(&tty_sessions, tty, avl, tmp)
        del_tty_session(tty);

    cl->send(cl, NULL, 0, WEBSOCKET_OP_CLOSE);
    cl->free(cl);

    if (auto_reconnect)
        uloop_timeout_set(&reconnect_timer, RECONNECT_INTERVAL * 1000);
    else
        uloop_end();
}

static void del_tty_session(struct tty_session *tty)
{
    avl_delete(&tty_sessions, &tty->avl);
    uloop_timeout_cancel(&tty->timer);
    uloop_process_delete(&tty->up);
    ustream_free(&tty->sfd.stream);
    close(tty->pty);
    kill(tty->pid, SIGTERM);
    waitpid(tty->pid, NULL, 0);
    close(tty->upfile.fd);
    ULOG_INFO("Del session:%s\n", tty->sid);
    free(tty);

    if (avl_is_empty(&tty_sessions)) {
        rtty_packet_free(pkt);
        pkt = NULL;
    }
}

Segmentation fault

openwrt@master - (OpenWrt GCC 7.3.0 r7803-14b6c72541)
rtty-openssl - 5.1.0-2

/etc/init.d/rtty start

produces:

Thu Aug  9 16:57:06 2018 kern.info kernel: [ 2325.629785] do_page_fault(): sending SIGSEGV to rtty for invalid write access to 7f785fd8
Thu Aug  9 16:57:06 2018 kern.info kernel: [ 2325.636600] epc = 7767a2a0 in libc.so[77652000+92000]
Thu Aug  9 16:57:06 2018 kern.info kernel: [ 2325.641547] ra  = 7767ab48 in libc.so[77652000+92000]
Thu Aug  9 16:57:11 2018 daemon.info rtty: (main.c:562) rtty version 5.1.0
Thu Aug  9 16:57:12 2018 daemon.err rtty: (main.c:429) onclose

installed dependencies:

libubox - 2018-07-25-c83a84af-2
libubox-lua - 2018-07-25-c83a84af-2
libprotobuf-c - v1.3.0-1
libopenssl - 1.0.2o-1
libuhttpd-openssl - 2.2.1-2
libustream-openssl - 2018-07-30-23a3f283-1
libuwsc-openssl - 2.0.4-1

For android

Is there any way to make the client run on android? With or without root. Or wrapping with any third party software?

启动不了

[root@wls12c ~]$ rtty -I 'sss' -h 'wls12c' -p 5912 -a -v -s -d 'My Device Description'
(main.c:453) libuwsc version 3.1.2
(main.c:454) rtty version 6.4.0
(main.c:280) onerror:6: Connection refused
(main.c:280) onerror:6: Connection refused

cat查看大文件导致客户端出错退出

cat 查看/var/log/下日志的时候出现客户端退出的情况。
日志文件200多KB
出现以下错误,经测试为100%重现。
Sat Dec 1 09:22:19 2018 daemon.err rtty: (main.c:276) onerror:1: write error
Sat Dec 1 09:22:24 2018 daemon.err rtty: (main.c:276) onerror:7: ssl handshake failed
Sat Dec 1 09:22:29 2018 daemon.err rtty: (main.c:276) onerror:1: read error
Sat Dec 1 09:23:58 2018 auth.info login[3636]: root login on 'pts/1'
Sat Dec 1 09:24:04 2018 daemon.err rtty: (main.c:276) onerror:1: write error

Openwrt client connect issue

On client connect from openwrt to server i get the error command login not found.

i guess its looking for /bin/login which is unavailable for openwrt

SgeFault on connect timeout

hi

i had to open UDP/TCP port on server to prevent core dump/segfault on connectio timeout for client.

main.c:407) libuwsc version 3.0.4
(main.c:408) rtty version 6.2.0
(main.c:247) onerror:6: Connect timeout
Segmentation fault (core dumped)

maybe Readme should indicated whether UDP or TCP or both need to be allowed on the specified/default port

ty

Behind the nginx.

When I used it behind nginx, it can't be used as a 'location'. The nginx.conf is like this:

location /rtty/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:5912;
}

For Windows

Hi Team,

First of all, Congrats and Thanks for this excellent project.
I am looking to compile this for the windows machine. Is there any possibilities for that?

Deb/Rpm package

I'm struggling with the installation of rtty: I managed to compile everything correctly but the first time I tried to launch rtty I got an error of a missing library. I thought: No problem! Let's create symbolic links. This worked for a couple of missing file but then I had to stop because the library libblobmsg_json.so is nowhere to be found, no matter where I link it. This is the error: "rtty: error while loading shared libraries: libblobmsg_json.so: cannot open shared object file: No such file or directory".

I tried by cloning from HEAD but also from the 4.1.1, with both ubuntu 16.04 and debian 9, 64 bit.

Do you have any idea why?

Do you think it would be possible to have a deb package or at least an install script so that everything is taken care of automatically?

Thanks in advance

客户端日志功能存在内存溢出问题

可能所有版本都有这个bug,就是在连接不上服务器的情况下,会出现内存溢出。
如果客户端一开始就能正常连接服务器的情况,内存占用很正常。但是,如果服务端时不时的连接不上就会出现内存被大量占用,并且不释放。

Problem login client

Hello good afternoon.
An excellent project.

I have a problem with the rtty client daemon does not accept my password.
The remote server is a minimum installation centos 7

This is the log.

19 de agosto 15:51:58 [localhost] rtty: (main.c: 122) Error de lectura de pty: Recurso temporalmente no disponible

tail -f /var/log/audit/audit.log
type=USER_AUTH msg=audit(1566241343.428:34632): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=PAM:authentication grantors=? acct="root" exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'
type=USER_LOGIN msg=audit(1566241345.152:34633): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=login id=0 exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'

type=USER_AUTH msg=audit(1566241379.399:34634): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=PAM:authentication grantors=? acct="root" exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'

type=USER_AUTH msg=audit(1566241343.428:34632): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=PAM:authentication grantors=? acct="root" exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'
type=USER_LOGIN msg=audit(1566241345.152:34633): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=login id=0 exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'

type=USER_AUTH msg=audit(1566241379.399:34634): pid=2007 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:unconfined_service_t:s0 msg='op=PAM:authentication grantors=? acct="root" exe="/usr/bin/login" hostname=dpbx addr=? terminal=pts/1 res=failed'

tail -f /var/log/messages
Aug 19 16:01:38 [localhost] rtty: (main.c:227) non-existent sid: 2
Aug 19 16:01:59 [localhost] rtty: (main.c:122) Read from pty failed: Resource temporarily unavailable

Segmentation fault at reconnect by double onclose()?

When the server rttys restarts, the client crashes instead of reconnecting
Is it because of double closing? Or what?

rtty version 4.1.1
onopen
(uwsc.c:440) Ping server, no response
:Resource temporarily unavailable
onclose
onclose
./rtty.sh: line 9: 15091 Segmentation fault      (core dumped) ./rtty -I ${ID} -h ${HOST} -p 5912 -P 60 -a -v -s -d "${DESC}"

Thank you

an automatic jump function for url

Hello, can you add an automatic jump function,
The url like this "http://XXXXX:port/rtty.html? Id=aaaaaaaa"; if URL includes id and correct, it automatically jumps or not it will stay the page.
I think this will be a great feature when RTTY support is added to the original device management platform.

v.6.1.1 payload to large

After login to web ssh rtty console and :

cat /var/log/rtty.log

console crashed and closed.

Rtty log for this:

Sep 20 09:35:27 chip rtty: (main.c:188) New session:dcb1cac7800a086efae6390e49884149
Sep 20 09:35:44 chip rtty: (uwsc.c:406) Payload too large
Sep 20 09:35:44 chip rtty: (uwsc.c:406) Payload too large
Sep 20 09:35:44 chip rtty: (uwsc.c:406) Payload too large
Sep 20 09:35:44 chip rtty: (main.c:480) onclose:1006: unexpected EOF
Sep 20 09:35:44 chip rtty: (main.c:89) Del session:dcb1cac7800a086efae6390e49884149
Sep 20 09:35:49 chip rtty: (uwsc.c:513) tcp_connect failed: Unknown error
root@chip:~# ls -l /var/log/rtty.log
-rw-r----- 1 root adm 2879645 Sep 20 09:39 /var/log/rtty.log

In previous 5 version this does worked

Latest 6.1.1 has crashing

(main.c:622) libuwsc version 2.0.1
(main.c:623) rtty version 6.1.1
(main.c:461) Connect to server succeed
(main.c:188) New session:2fdb1fc54ee149a30eb794857330df0f
(main.c:89) Del session:2fdb1fc54ee149a30eb794857330df0f
(main.c:466) onerror:4: Not support fragment
*** Error in `./rtty': realloc(): invalid pointer: 0x00007f43f0719818 ***
(main.c:622) libuwsc version 2.0.1
(main.c:623) rtty version 6.1.1
(main.c:461) Connect to server succeed
(main.c:188) New session:d5eb5fcbe57dffa66245a58a30263891
(main.c:89) Del session:d5eb5fcbe57dffa66245a58a30263891
(main.c:466) onerror:4: Not support fragment
./run.sh: line 15: 27606 Segmentation fault      ./rtty -I ${ID} -h ${SERVER} -p ${PORT} -a -v -d "${DESC}"

in work progress and at server stopping too.

error while loading shared libraries: libuwsc.so.2.0.1

$ sudo rtty -I 'ubuntu-1710' -h '192.168.0.100' -p 5912 -a -v -s -d 'My Device Description'
rtty: error while loading shared libraries: libuwsc.so.2.0.1: cannot open shared object file: No such file or directory

I got above error..
I have updated my system curl to latest
curl 7.59.0 (x86_64-pc-linux-gnu) libcurl/7.59.0

建议添加设备描述功能

设备端添加描述desc 的json字段上报到服务器端,增加设备id可读性,可以通过设备描述关联对应设备id,比如did="02AD23968063" desc="家里的路由器myhome router,服务器端/list 打开链接时上面附上设备描述就一目了然了

Adding a description to the device.

openwrt 15.05 无法clone

按照说明在openwrt15.05里面源码的feed中添加源,在update的时候出现无法clone
日志如下:
`
Updating feed 'rtty' from 'https://github.com/zhaojh329/rtty.git;openwrt-lede' ...
Cloning into './feeds/rtty'...
warning: Could not find remote branch openwrt-lede to clone.
fatal: Remote branch openwrt-lede not found in upstream origin
failed.

`

About root login rtty failure solution

If you log in as root on some Linux systems and find that you can't enter root, you will always report the login. The main reason is that the root login terminal is not recognized. You need to add the relevant terminal tty name in /etc/securetty. Look at the login information, for example my system is ubuntu18.04, I use cat /var/log/auth.log

Sep 6 08:06:29 wateras systemd-logind[2459]: New session c22 of user root.
Sep 6 08:12:15 wateras login[30773]: pam_securetty(login:auth): access denied: tty '/dev/pts/3' is not secure !
Sep 6 08:12:18 wateras login[30773]: FAILED LOGIN (1) on '/dev/pts/3' FOR 'root', Authentication failure
Sep 6 08:12:24 wateras login[30773]: pam_securetty(login:auth): access denied: tty '/dev/pts/3' is not secure !
I only need to add pts/3 to the /etc/securetty file. This is based on the error message. In practice, just add pts/0~pts/3. This way you can use root to log in to rtty.
ZVZM(%$EYV949O{LG7KTFVP
3{_J5L%)8U Y (P6SG6AVO](https://user-images.githubusercontent.com/3644814/64579423-72cba200-d3b5-11e9-866e-fe67865ac79a.png) ![Q{CNO_AS C6WQW7~ K@FWJ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.