Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
dangyuluo
V2EX  ›  Linux

有没有远程执行一个脚本,本机自动连接远程 shell 的工具?

  •  
  •   dangyuluo · Jun 9, 2021 · 2263 views
    This topic created in 1889 days ago, the information mentioned may be changed or developed.

    目的很单纯,就是在 CI 里添加一个脚本,当 CI 运行到某个脚本的时候,我能够 shell 进去查看一些运行情况。

    目前的做法是while [[ ! -f /tmp/continue ]]; do sleep 10; done;,然后查一下 CI 机器的 IP,SSH 进去然后docker exec。但是这样做很繁琐。

    有没有什么工具能够实现:将这个脚本上传到 Git 中,触发一个 CI pipeline,然后我本机打开某个引用等着就可以了。

    谢谢

    3 replies    2021-06-09 15:36:32 +08:00
    AoEiuV020
        1
    AoEiuV020  
       Jun 9, 2021
    第一个想到 tmate,但好像不太对,
    你是有个自己的 ci, 然后 ci 有个 ip 可以直连,但是 ip 会变?想不明白这什么场景,
    masterclock
        2
    masterclock  
       Jun 9, 2021
    听着是 反弹 shell ?
    远端
    socat tcp-connect:$RHOST:$RPORT exec:/bin/sh,pty,stderr,setsid,sigint,sane

    本地
    socat file:`tty`,raw,echo=0 tcp-listen:12345
    jingslunt
        3
    jingslunt  
       Jun 9, 2021
    服务端装个 jenkins 网页上触发脚本(或者定时)
    本地浏览器打开 jenkins 页面
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3264 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:33 · PVG 08:33 · LAX 17:33 · JFK 20:33
    ♥ Do have faith in what you're doing.