Ever wanted to use SSH to connect to an embedded Linux system over the serial port instead of suffering through some janky login program that supports very limited terminal features?

Well, I did, and the tooling didn't exist, so I made it.

It also supports ppp automatically.

cc @AMS @chaos

https://github.com/ryancdotorg/ugetty

GitHub - ryancdotorg/ugetty: A modern, lightweight, multi-protocol getty.

A modern, lightweight, multi-protocol getty. Contribute to ryancdotorg/ugetty development by creating an account on GitHub.

GitHub

@ryanc @AMS @chaos mind that there are current attempts to reduce the network size of 127/8 and AFAIHH FreeBSD already implements this.

execing sshd in inetd mode instead of connecting to a running one could also be interesting…

@mirabilos @AMS @chaos Yeah, I considered sshd -i, but that would have required environment manipulation. setenv() needs malloc, which ugetty doesn't otherwise use. Handling the identification string also requires reading it to detect it, then replaying it to sshd. This could be done by forking, replaying the string, then replacing the file descriptors (I think), but the socket method feels cleaner.

@ryanc @AMS @chaos ah, that is annoying, of course.

Can you MSG_PEEK on a serial port? Then you could indeed just exec.

@mirabilos @AMS @chaos I don't believe so, as a serial port is not a socket.
@ryanc @AMS @chaos might still have 15 bytes buffered or so…