[BusyBox] how to get login to ask for password on a given port?

Robert P. J. Day rpjday at mindspring.com
Tue Mar 23 18:22:00 UTC 2004


  (here's hoping i can describe this well enough to make sense.)

  i have a single-board computer to which i can connect from my host's 
serial port to a (debug) serial port on the board thru minicom.  once i 
boot the board, that port's device file is /dev/tts/0, and it acts as the 
console just fine.

  on the other side of the board is a DUART for which someone has written 
a driver to create another serial port.  we've already established that,
under linux, it's device file name is /dev/ttd/0, and we want to allow
logins on that port through a terminal emulator program (in this case,
hyperterm).

  sounds easy enough, we've built both getty and login into BB and, once
the system comes up, i can start a manual getty on that port:

  # getty -L 9600 ttd/0 &    # "-L" for local line, so don't do DCD

i start it in the background just so i can get the prompt back to run "ps"  
and, sure enough, there's a getty running there and, in addition, i have
/etc/issue printed and a login prompt generated on that port in hyperterm.  
so far, so good.

  however, when i type in the user name "root" and hit return, i get no 
response.  back at the console, via "ps", i can verify that the getty has 
been replaced by "/bin/login -- root", so getty clearly picked up the 
entered user name, and exec'ed login.

  the problem is that, back at the console, i get the message "getty
stopped (tty output)", clearly because it's trying to print something.
when i foreground it, i get the "Password:" prompt.  so the initial getty 
is told to generate a login prompt on /dev/ttd/0, it does so, it accepts 
the user name, and it exec's /bin/login, but /bin/login promptly (no pun 
intended) prompts for the password, not on /dev/ttd/0, but on the console
/dev/tts/0 -- definitely the wrong place.

  have i missed a critical option here?  how does getty pass on the info 
to /bin/login as to which port to continue to use?

rday



More information about the busybox mailing list