我正在使用 tty 控制台和 sshd 终端登录运行 ubuntu 服务器安装。 ssh 密钥和密码都可用于通过 sshd 进行身份验证。最近,在控制台上,当我尝试以文本模式登录时,我得到了一个奇怪的行为:我输入了我的登录名。它提示输入密码。然而,它很快就会打印一个换行符,并且我尚未输入的密码的任何部分都会以明文形式回显到控制台。然后,它提示登录:,但很快超时并再次提示登录:...5次,直到它返回清除屏幕,并重新发出agetty进程。此时它已“稳定”并再次等待用户名,但输入用户名并按 Enter 键会重新启动“超时和换行”行为。
getty@tty1 的 systemd 日志显示以下内容:
-- Unit [email protected] has finished starting up.
--
-- The start-up result is RESULT.
Feb 08 12:12:47 xps15 login[1610]: pam_unix(login:auth): conversation failed
Feb 08 12:12:47 xps15 login[1610]: pam_unix(login:auth): auth could not identify password for [jwatte]
Feb 08 12:12:50 xps15 login[1610]: FAILED LOGIN (1) on '/dev/tty1' FOR 'jwatte', Authentication failure
Feb 08 12:12:51 xps15 login[1610]: pam_securetty(login:auth): cannot determine username
Feb 08 12:12:54 xps15 login[1610]: FAILED LOGIN (2) on '/dev/tty1' FOR 'UNKNOWN', Error in service module
Feb 08 12:12:55 xps15 login[1610]: pam_securetty(login:auth): cannot determine username
Feb 08 12:12:58 xps15 login[1610]: FAILED LOGIN (3) on '/dev/tty1' FOR 'UNKNOWN', Error in service module
Feb 08 12:12:59 xps15 login[1610]: pam_securetty(login:auth): cannot determine username
Feb 08 12:13:03 xps15 login[1610]: FAILED LOGIN (4) on '/dev/tty1' FOR 'UNKNOWN', Error in service module
Feb 08 12:13:03 xps15 login[1610]: pam_securetty(login:auth): cannot determine username
Feb 08 12:13:06 xps15 login[1610]: FAILED LOGIN (5) on '/dev/tty1' FOR 'UNKNOWN', Error in service module
Feb 08 12:13:06 xps15 login[1610]: TOO MANY LOGIN TRIES (5) on '/dev/tty1' FOR 'UNKNOWN'
Feb 08 12:13:06 xps15 login[1610]: pam_mail(login:session): cannot determine username
Feb 08 12:13:06 xps15 login[1610]: pam_unix(login:session): close_session - error recovering username
Feb 08 12:13:06 xps15 systemd[1]: [email protected]: Service has no hold-off time, scheduling restart.
Feb 08 12:13:06 xps15 systemd[1]: [email protected]: Scheduled restart job, restart counter is at 1.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit [email protected] has been scheduled, as the result for
-- the configured Restart= setting for the unit.
我想问题出在前两行:
pam_unix(login:auth): conversation failed
pam_unix(login:auth): auth could not identify password for [jwatte]
为什么会发生这种情况,我怎样才能最好地调试它?
答案1
事实证明这是由以下原因引起的:https://askubuntu.com/questions/1113704/tty-doesnt-wait-for-password
我没有足够的魔力点来标记这个问题以重定向到那里,但感谢@PerlDuck 提供答案!