尊龙凯时人生就是博

LinuxϵͳÖеÄÓû§ÃÜÂë´æ´¢»úÖÆÆÊÎö

LinuxϵͳÖеÄÓû§ÃÜÂë´æ´¢»úÖÆÆÊÎö

ÔÚLinuxϵͳÖÐ £¬Óû§ÃÜÂëµÄ´æ´¢ÊǺÜÊÇÖ÷ÒªµÄÇå¾²»úÖÆÖ®Ò»¡£±¾ÎĽ«ÆÊÎöLinuxϵͳÖÐÓû§ÃÜÂëµÄ´æ´¢»úÖÆ £¬°üÀ¨ÃÜÂëµÄ¼ÓÃÜ´æ´¢¡¢ÃÜÂëµÄÑéÖ¤Àú³ÌÒÔ¼°ÔõÑùÇå¾²µØÖÎÀíÓû§ÃÜÂ롣ͬʱ £¬½«Í¨¹ýÏêϸµÄ´úÂëʾÀýչʾÃÜÂë´æ´¢µÄÏÖʵ²Ù×÷Àú³Ì¡£

Ò»¡¢ÃÜÂëµÄ¼ÓÃÜ´æ´¢

ÔÚLinuxϵͳÖÐ £¬Óû§ÃÜÂë²¢²»ÊÇÒÔÃ÷ÎĵÄÐÎʽ´æ´¢ÔÚϵͳÖÐ £¬¶øÊǾ­ÓɼÓÃܺóÉúÑÄ¡£LinuxϵͳÖг£ÓõÄÃÜÂë¼ÓÃÜËã·¨ÊÇSHA-512£¨SHA-256Ò²¿ÉÒÔʹÓã©¡£ÔÚLinuxϵͳÖÐ £¬Óû§µÄÃÜÂë´æ´¢ÔÚ/etc/shadowÎļþÖÐ £¬¸ÃÎļþÖÐÉúÑÄÁËÓû§µÄÕ˺ÅÐÅÏ¢ £¬°üÀ¨¼ÓÃܺóµÄÃÜÂë¡¢ÃÜÂëÓâÆÚʱ¼ä¡¢ÃÜÂë×îºóÐÞ¸Äʱ¼äµÈ¡£

ÏÂÃæÊÇÒ»¸öʾÀýµÄ/etc/shadowÎļþµÄÄÚÈÝ£º

root:$6$xld94ij$BW0RfSx9WLNAWia7D5PQwx/dNnhTgy8f3W6/vobqEmmhVUISZoL5EwrF8RTXA8xRztRGtUjLzxyBnUqVoJk7Z.:18474:0:99999:7:::
user1:$6$du065TO$9v6.LU3F8JbLVQ7FEQEfkrQ.Zd8dxR.Vl5ohZ9uiXG4lF8k1OHkRTrqtzc5RpaC2mvM5KpIe7YH2zUL3MOUEO1:18474:0:99999:7:::

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬µÚÒ»¸ö×Ö¶ÎÌåÏÖÓû§Ãû £¬µÚ¶þ¸ö×Ö¶ÎÊǼÓÃܺóµÄÃÜÂë¡£¿ÉÒÔ¿´µ½ £¬ÃÜÂëÒѾ­±»¼ÓÃܳÉÒ»¶ÎÂÒÂë £¬ÕâÑù×ÝÈ»/etc/shadowÎļþ±»Ð¹Â¶ £¬ºÚ¿ÍÒ²ºÜÄÑ»¹Ô­³öÓû§µÄÃÜÂë¡£

¶þ¡¢ÃÜÂëµÄÑéÖ¤Àú³Ì

µ±Óû§µÇ¼ϵͳʱ £¬ÏµÍ³»áÑéÖ¤Óû§ÊäÈëµÄÃÜÂëÊÇ·ñ׼ȷ¡£ÑéÖ¤ÃÜÂëµÄÀú³ÌÏÖʵÉϾÍÊǽ«Óû§ÊäÈëµÄÃÜÂëƾ֤ÏàͬµÄ¼ÓÃÜËã·¨¾ÙÐмÓÃÜ £¬È»ºóºÍ/etc/shadowÎļþÖеÄÃÜÂë¾ÙÐбȶÔ¡£ÈôÊÇÁ½ÕßÒ»Ö £¬ÔòÑéÖ¤ÀÖ³É £¬ÔÊÐíÓû§µÇ¼£»²»È»Ñé֤ʧ°Ü £¬¾Ü¾øÓû§µÇ¼¡£

ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄÃÜÂëÑéÖ¤µÄ´úÂëʾÀý £¬Ê¹ÓÃPython±àд£º

import crypt
import getpass

def validate_password(username, password):
    with open('/etc/shadow', 'r') as f:
        for line in f:
            if line.startswith(username + ':'):
                shadow_entry = line.split(':')
                encrypted_password = shadow_entry[1]
                salt = encrypted_password.split('$')[2]
                new_encrypted_password = crypt.crypt(password, '$6$' + salt + '$')
                if new_encrypted_password == encrypted_password:
                    return True
                else:
                    return False
    return False

username = input("Enter username: ")
password = getpass.getpass("Enter password: ")

if validate_password(username, password):
    print("Password is correct. Logging in...")
else:
    print("Password is incorrect. Please try again.")

µÇ¼ºó¸´ÖÆ

Èý¡¢Çå¾²µØÖÎÀíÓû§ÃÜÂë

ÖÎÀíÓû§ÃÜÂëÊÇÒ»¸öºÜÊÇÖ÷ÒªµÄÇå¾²ÎÊÌâ¡£Ê×ÏÈ £¬Ó¦¸Ã×èֹʹÓüòÆÓÃÜÂë £¬ÍƼöʹÓðüÀ¨¾Þϸд×Öĸ¡¢Êý×ÖºÍÌØÊâ×Ö·ûµÄÖØ´óÃÜÂë¡£Æä´Î £¬°´ÆÚÐÞ¸ÄÃÜÂë £¬×èֹʹÓÃͳһ¸öÃÜÂ볤ʱ¼äÎȹÌ¡£ÁíÍâ £¬²»Ó¦¸Ã½«ÃÜÂëÃ÷ÎÄ´æ´¢ÔÚÈκεط½ £¬°üÀ¨´úÂëÖС£

ÔÚLinuxϵͳÖÐ £¬ÖÎÀíÔ±¿ÉÒÔʹÓÃpasswdÏÂÁîÀ´ÐÞ¸ÄÓû§ÃÜÂë £¬¸ÃÏÂÁî»á×Ô¶¯½«Óû§ÃÜÂë¼ÓÃܺó´æ´¢µ½/etc/shadowÎļþÖС£ÁíÍâ £¬¿ÉÒÔʹÓÃһЩרÃŵÄÃÜÂëÖÎÀí¹¤¾ßÀ´×ÊÖúÖÎÀíÓû§µÄÃÜÂë £¬ÈçKeePass¡¢LastPassµÈ¡£

×ܽ᣺

LinuxϵͳÖеÄÓû§ÃÜÂë´æ´¢»úÖÆÊǺÜÊÇÖ÷ÒªµÄÇå¾²»úÖÆ £¬Í¨¹ý¼ÓÃÜ´æ´¢ºÍÑÏ¿áµÄÑéÖ¤Àú³Ì £¬±£»¤ÁËÓû§ÃÜÂë²»±»ÈÝÒ×й¶¡£ÖÎÀíÔ±ÐèÒª°´ÆÚÉó²éÃÜÂëÕ½ÂÔ £¬È·±£Óû§ÃÜÂëµÄÇå¾²ÐÔ¡£Í¬Ê± £¬Óû§Ò²ÐèҪעÖØÃÜÂëµÄÇå¾²ÐÔ £¬×èֹʹÓüòÆÓÃÜÂëºÍ½«ÃÜÂëÃ÷ÎÄ´æ´¢ÔÚ²»Çå¾²µÄµØ·½¡£

ͨ¹ý±¾ÎĵÄÆÊÎöºÍ´úÂëʾÀý £¬Ï£Íû¶ÁÕ߶ÔLinuxϵͳÖÐÓû§ÃÜÂëµÄ´æ´¢»úÖÆÓиüÉîÈëµÄÏàʶ £¬ÒÔÌá¸ßϵͳµÄÇå¾²ÐÔ¡£

¡¾×ÖÊý£º798×Ö¡¿

ÒÔÉϾÍÊÇLinuxϵͳÖеÄÓû§ÃÜÂë´æ´¢»úÖÆÆÊÎöµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ