我只是好奇,Ubuntu 中的用户名和相关密码存储在哪里?登录时如何验证?
答案1
密码(以散列形式)可以在 /etc/shadow 中找到,而用户则可以在 /etc/passwd 中找到。
login 程序用于与系统建立新会话。它通常通过响应用户终端上的 login: 提示自动调用。login 可能对 shell 来说是特殊的,不能作为子进程调用。通常,shell 将 login 视为 exec login,这会导致用户退出当前 shell。尝试从除 login shell 之外的任何 shell 执行 login 都会产生错误消息。
The user is then prompted for a password, where appropriate. Echoing is
disabled to prevent revealing the password. Only a small number of
password failures are permitted before login exits and the
communications link is severed.
If password aging has been enabled for your account, you may be
prompted for a new password before proceeding. You will be forced to
provide your old password and the new password before continuing.
Please refer to passwd(1) for more information.
更多信息请访问:http://manpages.ubuntu.com/manpages/hardy/man1/login.1.html
http://manpages.ubuntu.com/manpages/hardy/man5/passwd.5.html