Red Hat Bugzilla – Bug 851827
Can't log in on USB serial console
Last modified: 2013-02-01 11:40:22 EST
I set up a system with a USB serial console (using a PL2303 adapter) by adding to the kernel command line:
On system boot, I see the kernel messages and get to a login prompt. However, when I enter a username and hit return, it just sits there for a few seconds and then goes back to the login prompt. I get this in /var/log/secure:
Aug 25 23:29:48 vm login: pam_unix(login:auth): conversation failed
Aug 25 23:29:48 vm login: pam_unix(login:auth): auth could not identify password for [cmadams]
Aug 25 23:29:48 vm login: FAILED LOGIN 1 FROM ttyUSB0 FOR cmadams, Authentication failure
Aug 25 23:29:48 vm login: pam_securetty(login:auth): cannot determine username
Aug 25 23:29:48 vm login: pam_succeed_if(login:auth): error retrieving user name: Conversation error
Aug 25 23:29:48 vm login: FAILED LOGIN SESSION FROM ttyUSB0 FOR (unknown), Error in service module
Running strace on the agetty, I see it exec login, but when it gets to printing the "Password:" prompt, the write() call gets EIO (and so does the following read() call trying to get the input).
If I boot the kernel without the serial console, and then just start a getty manually with "systemctl start serial-getty@ttyUSB0.service", login works, but of course I don't get the kernel console messages.
I'm not sure if this is a kernel bug or a login bug, but I thought I'd start here first.
I have also seen this problem in an armv7l system with kernel 3.4.5 and a ch341 usb-tty dongle. This smells like a kernel bug to me, but if I modify login to close 0, 1 and 2 prior to opening ttyUSB0 and then duping 0 to 1 and 2, then login works as expected.
(In reply to comment #1)
> I have also seen this problem in an armv7l system with kernel 3.4.5 and a
> ch341 usb-tty dongle. This smells like a kernel bug to me, but if I modify
> login to close 0, 1 and 2 prior to opening ttyUSB0 and then duping 0 to 1
> and 2, then login works as expected.
Roy, do you mean something like: https://lkml.org/lkml/2012/6/5/145
This should be supported since util-linux 2.22 (f18).
Karel, I was closing the 0, 1 and 2 in open_tty so it was after the vhangup.
I have compiled login out of util-linux 2.22 and it works OK on my USB system console port.