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

Be able to restart a session? #106

Open
computersarecool opened this issue Sep 27, 2015 · 10 comments · May be fixed by #213
Open

Be able to restart a session? #106

computersarecool opened this issue Sep 27, 2015 · 10 comments · May be fixed by #213

Comments

@computersarecool
Copy link

When something happens, like if we sign out of tmux or something, frequently you get:

Mosh has exited. Press "x" to close the window.

Would it be possible to add an option to start a new mosh session?

@rpwoodbu
Copy link
Owner

At first I misunderstood what you meant, but I think you would just like something similar to:

Mosh has exited. Press "r" to reconnect, or "x" to close the window.

Is that correct?

@rpwoodbu rpwoodbu reopened this Sep 28, 2015
@computersarecool
Copy link
Author

Yes, that is exactly what I meant. It would be a great feature to have. In secure shell this option appears most of the time when you exit a connection I believe.

@rpwoodbu
Copy link
Owner

Indeed, Secure Shell is where I got the inspiration for the "x". I never put in "r" since an unintended disconnection almost never happens with mosh, compared to ssh where it happens constantly.

That said, I'm not averse to it, and it should be easy to do. It just isn't something I need, so I'll probably only get around to it next time I have go delve into the JS for some other reason.

This would be a fantastic bite-sized community contribution for anyone looking to get involved; pull requests are welcome! Note for any potential implementer: This will only work for ssh-initiated sessions, so the option should not be available for manually-initiated sessions.

@computersarecool
Copy link
Author

Sounds good to me. And yes, I wouldn't make it a high priority for the reasons you mentioned. Maybe I will take a look at the source. If you say its manageable maybe I can contribute. Thanks for your input and for Mosh Chrome.

@fortran77
Copy link

A reconnect option would be useful because (in the case of the Chrome OS client, which does not seem to have any way of consulting an authentication agent) it would avoid the need to retype one's private key.

Also, while unintended disconnects don't happen very often, intended disconnects do, such as when one deliberately reboots the remote server.

@rpwoodbu
Copy link
Owner

rpwoodbu commented Dec 5, 2015

@fortran77 For security reasons, the app throws away the private key as soon as it is done with it, so it isn't as simple as it would seem to offer a challenge-less reconnect.

However, Mosh for Chrome can actually talk to a special non-public SSH agent app. It uses the same protocol as was implemented for the Secure Shell app. Right now the ID of the agent app is hard-coded to one not meant for public use, but if someone writes a public one, it would be easy to let the user specify the app ID to use.

@fortran77
Copy link

  1. If it ever became possible for multiple mosh client window processes to communicate with one another via messages or shared memory, then the first window opened could retain the private key in memory, and act as the authentication agent for subsequently-opened windows. Then only the first window would need to keep the key in memory, which would be more secure than each one keeping the key in memory.
  2. In developer mode, Chrome OS (on Chromebooks and Chromeboxes) already provides an authentication agent (/usr/bin/ssh-agent), which works nicely when I invoke ssh from the shell. Maybe mosh could call the same agent.

@rpwoodbu
Copy link
Owner

rpwoodbu commented Dec 5, 2015

Leaving the key in the memory of any window is a security risk. Limiting to one particular window doesn't really help.

As I said, there's already a mechanism to communicate with an external agent app. That's the way to do this. Let the user decide the level of security by choosing an agent app that has the desired properties.

Maybe an easy first step would be for someone to write an app that just forwards the agent protocol between Mosh for Chrome and ssh-agent in dev mode (assuming the security model allows for that).

Anyway, this is all a little off-topic for this issue. This issue will be resolved simply by adding an 'r' option to reconnect. Pull requests are welcome!

@computersarecool
Copy link
Author

Thank you for this information.

@rpwoodbu
Copy link
Owner

This issue is still valid! It got a little off-topic, though. It is entirely reasonable to add a reconnect key. Again, pull requests are welcome!

@rpwoodbu rpwoodbu reopened this Mar 11, 2016
vapier added a commit to vapier/mosh-chrome that referenced this issue Dec 10, 2020
vapier added a commit to vapier/mosh-chrome that referenced this issue Dec 10, 2020
@vapier vapier linked a pull request Dec 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants