You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by 小号 <28...@qq.com> on 2020/12/18 03:23:51 UTC

apache sshd

Hello, is there an example of ssh server capturing the user's exit by inputting crtl + C?


你好,有没有ssh server 捕获用户输入crtl + c 退出的例子?

Re: apache sshd

Posted by Guillaume Nodet <gn...@apache.org>.
Yes, you can have a look at the the JLine SSH support (
https://github.com/jline/jline3/blob/860c0d64a874ab7e327b0a21cc434a9aaf232149/remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java
).
What you need is to configure the SSH connection with the correct control
char (
https://github.com/jline/jline3/blob/860c0d64a874ab7e327b0a21cc434a9aaf232149/remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java#L181),
then handle the INT interrupt signal and forward through the SSH channel (
https://github.com/jline/jline3/blob/860c0d64a874ab7e327b0a21cc434a9aaf232149/remote-ssh/src/main/java/org/jline/builtins/ssh/Ssh.java#L250-L257
)

Le ven. 18 déc. 2020 à 05:50, 小号 <28...@qq.com> a écrit :

> Hello, is there an example of ssh server capturing the user's exit by
> inputting crtl + C?
>
>
> 你好,有没有ssh server 捕获用户输入crtl + c 退出的例子?



-- 
------------------------
Guillaume Nodet