Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance to keep ssh sessions running in the background ? #107

Open
silkyclouds opened this issue Aug 24, 2022 · 7 comments
Open

Any chance to keep ssh sessions running in the background ? #107

silkyclouds opened this issue Aug 24, 2022 · 7 comments

Comments

@silkyclouds
Copy link

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 !

@nirui
Copy link
Owner

nirui commented Aug 24, 2022

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 :(

@silkyclouds
Copy link
Author

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 ? :)

@nirui
Copy link
Owner

nirui commented Aug 24, 2022

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?

@ql-owo-lp
Copy link

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.

@CJendantix
Copy link
Contributor

CJendantix commented Jan 22, 2023

@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.

@ql-owo-lp
Copy link

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

@CJendantix
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants