关于Linux中密码校验过程的部分函数

目录

1. 密码存储位置

2. 解析密码

3. 加密

4. 从终端读入一个指令

5.练习


1. 密码存储位置

        /etc/shadow 普通用户没有读权限--》sudo

2. 解析密码

#include <shadow.h>

struct spwd *getspnam(const char *name);
struct spwd {
    char *sp_namp;     /* Login name     用户登录名 */
    char *sp_pwdp;     /* Encrypted password 加密的密码 */
    long  sp_lstchg;   /* Date of last change
                          (measured in days since
                          1970-01-01 00:00:00 +0000 (UTC)) 密码最后一次修改的时间 */
    long  sp_min;      /* Min # of days between changes 修改密码的最小的时间间隔*/
    long  sp_max;      /* Max # of days between changes */
    long  sp_warn;     /* # of days before password expires
                          to warn user to change it  在密码到期前几天警告用户更改密码*/
    long  sp_inact;    /* # of days after password expires
                          un
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值