📄 pwdauth.8
字号:
.TH PWDAUTH.SH NAMEpwdauth \- password authentication program.SH SYNOPSIS.B /usr/lib/pwdauth.SH DESCRIPTION.B Pwdauthis a program that is used by the.BR crypt (3)function to do the hard work. It is a setuid root utility so that it isable to read the shadow password file..PP.B Pwdauthexpects on standard input two null terminated strings, thepassword typed by the user, and the salt. That is, the two arguments ofthe.B cryptfunction. The input read in a single read call must be 1024 characters orless including the nulls..B Pwdauthtakes one of two actions depending on the salt..PPIf the salt has the form "\fB##\fIuser\fR" then the.I useris used to index the shadow password file to obtain the encrypted password.The input password is encrypted with the one-way encryption functioncontained within.B pwdauthand compared to the encrypted password from the shadow password file. Ifequal then.B pwdauthreturns the string "\fB##\fIuser\fR" with exit code 0, otherwise exitcode 2 to signal failure. The string "\fB##\fIuser\fR" is also returnedif both the shadow password and the input password are null strings toallow a password-less login..PPIf the salt is not of the form "\fB##\fIuser\fR" then the password isencrypted and the result of the encryption is returned. If salt andpassword are null strings then a null string is returned..PPThe return value is written to standard output as a null terminated stringof 1024 characters or less including the null..PPThe exit code is 1 on any error..SH "SEE ALSO".BR crypt (3),.BR passwd (5)..SH NOTESA password must be checked like in this example:.PP.RSpw_ok = (strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd) == 0);.RE.PPThe second argument of crypt must be the entire encrypted password andnot just the two character salt..SH AUTHORKees J. Bot (kjb@cs.vu.nl)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -