Where is /bin/login started?

0

So I'm currenly learing sysVinit. I know that at startup /bin/login has to be started in order to display a login prompt but I couldn't find a file that starts it. Is it started by default in terminals specified in inittab or what's going on there?

zakrent

Posted 2018-12-16T12:42:19.673

Reputation: 3

Answers

2

It is started by getty after the username is input.

  1. Init starts /bin/agetty (or another getty) on each terminal, according to inittab
  2. Getty initializes the terminal, shows /etc/issue and the "login:" prompt
  3. User enters the login name
  4. Getty execs /bin/login with the username as parameter
  5. Login shows the password prompt (internal or from PAM)

(Note: login was also used for remote Telnet logins (although not by ssh logins), and the process was similar: telnetd would show the username prompt, and would start login for password prompt.)

In systemd, the process is nearly the same: init starts agetty according to getty@<tty>.service, and agetty starts login.

user1686

Posted 2018-12-16T12:42:19.673

Reputation: 283 655