by mindcrime · 5y ago · 0 comments
For the longest time I thought the "way to do that" probably involved some crazy sshd config or something, but then the penny dropped and I realized "Well shit, you could just make it a shell and set the user's shell entry to that program. Duh."
If somebody knows a better approach to that sort of thing, I'd love to hear about it. But for now I'm content that I've found an approach that seems workable.
(and if you're wondering more: No, this isn't anything interesting, or a startup project, or anything you'd probably even see on Show HN. It's just an example of the kind of random crap I think about in between doing other things.)
Funny you would mention that... using a curses or TurboVision based TUI app is kinda what I was thinking about that inspired this hole avenue of exploration.
https://github.com/KSP-KOS/KOS/blob/develop/src/kOS/UserIO/T...
Unfortunately, it appears the solution was to write an entirely custom telnet server. Author also says in the included documentation that SSH was the original plan but implementing all of SSH is far too complicated.
A couple of succinct examples I found via a quick google:
https://www.virtono.com/community/tutorial-how-to/restrict-e...
https://ctrlnotes.com/restrict-a-user-to-ssh-forced-command/...
You could also use Match in sshd_config and ForceCommand too.
Innocent times.