rien / reStream

Stream your reMarkable screen over SSH.
MIT License
732 stars 56 forks source link

Use a persistent SSH connection #83

Closed captn3m0 closed 6 months ago

captn3m0 commented 2 years ago

Currently, the reStream shell script calls ssh 6-7 times.

I ssh to the Remarkable using my Yubikey with a touch policy configured. The policy requires me to touch the Yubikey for every invocation of SSH (the handshake ie). That means a rmview session is more painful to setup than it needs to be.

I found some solutions here: https://serverfault.com/questions/216125/how-can-i-create-persistent-ssh-connection-to-stream-commands-over-a-period-of and https://unix.stackexchange.com/questions/552723/store-a-remote-ssh-session/553028#553028

If any of them feel good enough, I can file a PR.

1dotd4 commented 2 years ago

You may want to create a dedicated SSH key just for your reMarkable instead. Moreover, the methods you suggested doesn't allow to redirect the output from ssh. EDIT: The FIFO file may work if the stream can actually be written there.

rien commented 2 years ago

Having to touch your Yubikey seven times before being able to use this script can indeed be very frustrating. So I will gladly help you with finding a fix for that situation.

However, changing reStream to use a single SSH connection will be complex, because sometimes we parse the result of an ssh command, and sometimes we pipe the result to another file. As an extra complexity, the last command will output a binary stream which can be annoying to handle in the shell.

I think there are other solutions which will also fix your problem, without needing to complicate the current script further.

Please let me know which solution works best. I'll add some documentation to the README for others with the same problem.

captn3m0 commented 2 years ago

I'd tried the ssh -MNf flow, but had added it to the script instead of running it separately. Will try it again and report back 👍🏽

The key works over WiFi as well, so I'd like to keep using my Yubikey if possible.