-
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:::format
<username>:<encrypt_passwd>:....<encrypt_passwd>:
$(type_code)$salt$<encrypt_read_passwd>this example the whole password is $6$dgsEcbMj$rjqoKIiLcvY2XZv1hYJieV2a91W0LH0DsctmKjBC2bmWT2u2SLj4eI0g33UMOobjvpp/QJWZHvJwIWgjJm//a/ one can use salt=’$(type_code)$salt$’ salt is $6$dgsEcbMj$ if the real passwd is ‘bigdata’
crypt("bigdata","$6$dgsEcbMj$")to get encrypt_encrypt_passwd
C, Linux, user login