On Wed, 2020-05-20 at 17:00 -0500, Edgar Pettijohn wrote: > On Wed, May 20, 2020 at 09:50:17PM + > > > > I believe /etc/ttys controls getty, which may or not help. Getty is > > respawned too. > > https://man.openbsd.org/man5/ttys.5 > > I think you're right. Might just need to change a line in /etc/ttys > to > execute /bin/{my_program}. > > Edgar >
Perhaps a better way would be just to change the user's login shell to the name of your program: chpass -s $myprogram $user. That way you can use OpenBSD's login authentication, and login automatically runs the program when the user logs in; when the user quits the program they are automatically logged out. Provided there's no way to execute a shell from within the program, they therefore can't execute arbitrary code once logged in. It's easy to add a user for this single purpose: just add the user as normal, and specify $myprogram as the shell. Jeff.

