sshwifty icon indicating copy to clipboard operation
sshwifty copied to clipboard

Any chance to keep ssh sessions running in the background ?

Open silkyclouds opened this issue 2 years ago • 7 comments

Hi there,

It would be pretty convenient for me to keep all my ssh sessions open and find them back all connected when I do connect sshwifty.

For now, each time I close my browser tab, all existing/connected ssh sessions are disconnected.

Is it possible to get sshwifty to act as a bouncer ? I'm thinking about something like thelounge, keeping your irc connection alive, you simply can jump back in whenever you want :)

Thanks !

silkyclouds avatar Aug 24 '22 08:08 silkyclouds

Hi :)

Currently Sshwifty does not support any kind of session retaining feature since this software is really functionally simple.

This might change in the future, but as of now, I'm afraid I could only provide you with this disappointing information :(

nirui avatar Aug 24 '22 12:08 nirui

Thanks for your fast answer ! As this is supposed to run in a web browser, and in a docker, can't we simply not close the ssh sessions when the webui gets closed ? :)

silkyclouds avatar Aug 24 '22 13:08 silkyclouds

The reality is little bit more than that.

Currently, Sshwifty rely on Websocket connections to transport actual service data. And the connection is stateless, meaning one connection will never change the states of another connection. Not only this design is secure (connections are automatically isolated), it also allows Sshwifty to scale horizontally (theoretically infinitely).

The downside if it, is that the server will instantly forgot everything associated to the connection once the connection is dropped.

Adding session retaining feature requires a new system to keep track on active SSH sessions so they can be KeepAlive/expired. At the same time the system must also capable of allocating returned users back to the exact Sshwifty instance that is retaining their sessions.

That's easily the next level of complicity. And there are implications on security as well, since... you know.. session leak is beyond just bad.

I'm currently taking my time to figure it out, and there is no news so far :(

In the meantime, maybe try tmux on your SSH server, see if it could ease the problem?

nirui avatar Aug 24 '22 14:08 nirui

Can we specify a startup command whenever a connection is established? If that's possible I can just attach to my session automatically everytime after connection.

ql-owo-lp avatar Nov 07 '22 18:11 ql-owo-lp

@kevinxw Sshwifty supports connection links: https://{Sshwifty Site}/#+SSH:{User}@{Server}|{Authentication Method} {Character Encoding} And you can get the link by doing this image So I don't see the reason to do this when you can simply bookmark your connection already.

CJendantix avatar Jan 22 '23 13:01 CJendantix

I was referring to startup command, like the "RemoteCommand" in ssh config, not bookmarking. The goal is to not lose she session after disconnecting. E.g. I can put tmux command in the startup command

ql-owo-lp avatar Mar 11 '23 21:03 ql-owo-lp

Ah, I didn't know how tmux worked, or what you meant. This is most likely possible, but I do not know, nor understand the api Ni uses.

CJendantix avatar Mar 29 '23 14:03 CJendantix