Socat:允许重新连接到会话
我可以使用本地 PTY 链接设置 SSH 连接 - 我希望能够向远程端发送一些触发器,然后使用 screen 或 minicom 连接到会话,即:
socat PTY,link=/tmp/foo,raw,echo=0 EXEC:"ssh otherbox"
(或后台 socat)中
echo "securepassword|sudo -S bash"
screen /tmp/foo
然后在另一个窗口 问题是 - 在回显之后,socat 断开 EXEC - 而不是保持它打开以便 PTY 连接继续。
有什么想法吗? (我可以用expect或empty-expect来做到这一点,但它对前者很感兴趣,而缓冲则在会话的交互部分中搞砸了后者。)
I can setup an SSH connection with a local PTY link - and I want to be able to send some triggers to the remote end, then use screen or minicom to connect to the session ie:
socat PTY,link=/tmp/foo,raw,echo=0 EXEC:"ssh otherbox"
Then in another window (or background the socat)
echo "securepassword|sudo -S bash"
screen /tmp/foo
The trouble is - after the echo, socat disconnects the EXEC - rather than keeping it open so that the PTY connection carries on.
Any ideas? (I can sort of do this with expect or empty-expect, but its a faf with the former and buffering screws up the latter for the interactive part of the session.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论