huashengdun / webssh

:seedling: Web based ssh client
https://webssh.huashengdun.org/
MIT License
4.48k stars 1.26k forks source link

SSH KeepAlive #250

Open ssnmworld opened 2 years ago

ssnmworld commented 2 years ago

Hi - Is there any option that supports SSH KeepAlive seconds as it is supported in Putty ?

Some of our servers terminate SSH session - so we enable this options to have the session alive till the user terminates. Is there a way I can enable that in webssh ?

Thanks

gaoxiaodiao commented 1 year ago

Hi @ssnmworld I met the same situation, and my solution is to add the below codes in the "handler.py" file:

ssh.connect(*args, timeout=options.timeout)
transport = ssh.get_transport()
transport.set_keepalive(60)

I hope It can help you.

x2y2 commented 11 months ago

set websocket_ping_interval greater than 0

fawazahmed0 commented 11 months ago

I have tried all the above suggestions, but nothing worked. Here is the workaround, just execute the below line in your webssh terminal(browser)

while true; do echo ''; sleep 60; done &
OnieMa commented 10 months ago

设置 websocket_ping_interval 大于 0 在哪里设置呀?