lets say that I have a program that is running in tty1 displaying a menu, one of the entry of this menu is to have access to the shell, which command can I start to be able to have a prompt asking for login / password ?
Thanks.
The login command is what I need to display a normal login / password prompt. The trick is to start the command by using exec
The login program is used to establish a new session with the system. It is normally invoked automatically by responding to the "login:" prompt on the user's terminal. login may be special to the shell and may not be invoked as a sub-process. When called from a shell, login should be executed as exec login which will cause the user to exit from the current shell (and thus will prevent the new logged in user to return to the session of the caller). Attempting to execute login from any shell but the login shell will produce an error message.
login(1) is not setuid. Have you considered using su(1)?
login?