xibbon / LaTerminal

50 stars 2 forks source link

preservatorError when connecting over Tailscale and using Tailscale SSH for auth #13

Closed sumitgouthaman closed 1 year ago

sumitgouthaman commented 1 year ago

Fantastic app! Running into a minor issue when connecting using Tailscale SSH (fails on first try, works on immediate retry).

My environment:

What I expect to happen:

What happens:

Steps to reproduce:

LaTerminal_TailscaleSSH LaTerminal_TailscaleSSH_2

bradfitz commented 1 year ago

I'm one of the Tailscale SSH developers (along with @maisem, @mihaip). We run a public SSH test server that simulates Tailscale SSH's auth type ("none") for SSH client authors to hit to test their SSH code against:

Observe OpenSSH works:

$ ssh -v -p  2222 188.166.70.128
....
debug1: Authentication succeeded (none).

Then compare your SSH client against that 188.166.70.128 (on port 2222).

migueldeicaza commented 1 year ago

@sumitgouthaman thanks for the bug report. One quick work-around is to change your session preservation for the host from "native" to "tmux". It is not ideal, but it will do for now. I'll look into setting up a Tailscale SSH server locally.

@bradfitz Does the tailscale server support SFTP? At least the public server does not seem to support it, which is what is preventing the preservator from running:

migueldeicaza commented 1 year ago

I believe I have a workaround for a gap in the tailscale SSH server, would you like to try it out?

If so, you can try the build with Testflight here:

https://testflight.apple.com/join/cpPS8YnX

sumitgouthaman commented 1 year ago

I don't have my ipad with me to reproduce on the same device as comment #1. But on the iPhone with the testflight version, it does run into an error. IMG_0722

migueldeicaza commented 1 year ago

Thanks for sharing, I can reproduce this issue, sadly, it is not the fundamental problem, which is that it seems like the tailscale server sometimes does not accept SFTP connections. I am trying to find out what is going on here.

migueldeicaza commented 1 year ago

Thanks to @bradfitz I know why you are getting the error above: what happens is that your tailscale is not authenticated, and that is why the SFTP connection hangs, it is waiting for the re-authentication to take place. I could not see it, because I had some sort of do-not-disturb enabled (I was trying the iOS feature where it automatically guesses what notifications to let through, once I turned it off, I got the notification).

That said, I am working to detect the login request, and direct the user to that.

migueldeicaza commented 1 year ago

There is a patch in the AppStore, and the new update makes this even more reliable.