0

I have installed pam_script.so into my /lib/security/ folder and created a simple curses application at /etc/security/onsessionopen which executes whenever I attempt to login.

The script is executed, this much I know, but the terminal is not altered to show the curses application and instead it just logs out.

How can I force the ncurses application to show?

tetris11
  • 817
  • 2
  • 11
  • 27

1 Answers1

0

The answer is to force your own TTY and run the terminal application in there.

For more simple echoing, find the /dev/pts file descriptor that the current shell is using and direct all commands there.

pam_script.so is immensely useful.

Here's my working curses application with PAM setup which executes after 4 wrong attempts:

https://bitbucket.org/tetris11/custom-pam-curses-warning/

tetris11
  • 817
  • 2
  • 11
  • 27