Restricting access to a terminal

You can configure the operating system to restrict terminal access.

The getty and shell commands change the owner and mode of a terminal to prevent untrusted programs from accessing the terminal. The operating system provides a way to configure exclusive terminal access.