-
Notifications
You must be signed in to change notification settings - Fork 0
Linux auth method
source edited this page Oct 24, 2016
·
2 revisions
struct spwd * p=getspnam("username");
printf("passwd=%s\n",p->sp_spwd);bigdata:$6$dgsEcbMj$rjqoKIiLcvY2XZv1hYJieV2a91W0LH0DsctmKjBC2bmWT2u2SLj4eI0g33UMOobjvpp/QJWZHvJwIWgjJm//a/:17008:0:99999:7::: <username>:<encrypt_passwd>:.... <encrypt_passwd>: $(type_code)$salt$<encrypt_read_passwd>
one can use salt=’$(type_code)$salt$’
crypt(input_passwd,salt)to get encrypt_encrypt_passwd
C, Linux, user login