Éó²éLinuxϵͳÖеÄËùÓÐÓû§
ÔÚLinuxϵͳÖУ¬ÎÒÃǾ³£ÐèÒªÉó²éÄ¿½ñϵͳÖб£´æÄÄЩÓû§Õ˺ţ¬ÒÔ±ãÖÎÀíºÍά»¤ÏµÍ³¡£±¾ÎĽ«ÏÈÈÝһЩÔÚLinuxϵͳÖÐÉó²éËùÓÐÓû§µÄÒªÁ죬°üÀ¨Ê¹ÓÃÏÂÁîÐкÍͼÐνçÃæÁ½ÖÖ·½·¨¡£
ÒªÁìÒ»£ºÊ¹ÓÃÏÂÁîÐÐ
1. ʹÓÃ/etc/passwdÎļþ
/etc/passwdÎļþÊÇLinuxϵͳÖд洢Óû§Õ˺ÅÐÅÏ¢µÄÎļþ£¬Ã¿Ðдú±íÒ»¸öÓû§Õ˺š£ÎÒÃÇ¿ÉÒÔͨ¹ýÉó²é¸ÃÎļþÀ´»ñȡϵͳÖеÄËùÓÐÓû§¡£
Ê×ÏÈ£¬·¿ªÖնˣ¬ÊäÈëÒÔÏÂÏÂÁ
cat /etc/passwd
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁî»áÏÔʾ³ö/etc/passwdÎļþµÄÄÚÈÝ£¬ÆäÖаüÀ¨ÏµÍ³ÖеÄËùÓÐÓû§Õ˺ÅÐÅÏ¢¡£
2. ʹÓÃgetentÏÂÁî
getentÏÂÁîÄܹ»»ñȡϵͳÓû§ºÍ×éÐÅÏ¢£¬°üÀ¨´Ó/etc/passwdÎļþÖлñÈ¡Óû§Õ˺ÅÐÅÏ¢¡£ÊäÈëÒÔÏÂÏÂÁ
getent passwd
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÁгöϵͳÖеÄËùÓÐÓû§Õ˺ÅÐÅÏ¢¡£
3. ʹÓÃcutÏÂÁîÍŽá/etc/passwdÎļþ
ÎÒÃÇÒ²¿ÉÒÔÍŽáʹÓÃcutÏÂÁֻÊä³öÓû§ÃûÁÐÀ´Éó²éËùÓÐÓû§¡£ÊäÈëÒÔÏÂÏÂÁ
cut -d: -f1 /etc/passwd
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÁгö/etc/passwdÎļþÖÐËùÓÐÓû§µÄÓû§Ãû¡£
ÒªÁì¶þ£ºÊ¹ÓÃͼÐνçÃæ
1. ʹÓÃϵͳÖÎÀí¹¤¾ß
ÔÚ´ó´ó¶¼Linux¿¯ÐаæÖУ¬¶¼ÌṩÁËϵͳÖÎÀí¹¤¾ßÀ´ÖÎÀíÓû§Õ˺š£¿ÉÒÔ·¿ªÏµÍ³ÉèÖûòÕßÖÎÀíÓ¦ÓóÌÐò£¬ÕÒµ½Óû§ÕË»§Ñ¡Ï¼´¿ÉÉó²éϵͳÖеÄËùÓÐÓû§ÁÐ±í¡£
2. ʹÓÃÓû§ºÍ×éÖÎÀí¹¤¾ß
ijЩͼÐνçÃ湤¾ß£¬ÈçÓû§ºÍ×éÖÎÀí¹¤¾ß£¨User and Group Management£©£¬ÌṩÁËÉó²éÓû§ÁбíµÄ¹¦Ð§¡£¿ÉÒÔͨ¹ýÕâÖÖ¹¤¾ßÀ´Éó²éÏÖÓÐÓû§Õ˺š£
×ܽá
ͨ¹ýÒÔÉÏÒªÁ죬ÎÒÃÇ¿ÉÒÔÔÚLinuxϵͳÖÐÉó²éËùÓÐÓû§Õ˺ŵÄÐÅÏ¢¡£Ê¹ÓÃÏÂÁîÐпÉÒÔ¸ü¿ì½ÝµØ»ñÈ¡Óû§ÐÅÏ¢£¬¶øͼÐνçÃæÔòÔ½·¢Ö±¹ÛºÍÒ×Óá£Æ¾Ö¤ÏÖʵÐèÇóÑ¡ÔñºÏÊʵÄÒªÁìÀ´Éó²éϵͳÖеÄÓû§Õ˺ÅÁÐ±í¡£
Ï£ÍûÒÔÉÏÏÈÈÝÄܹ»×ÊÖúÄú¸üºÃµØÏàʶÔõÑùÔÚLinuxϵͳÖÐÉó²éËùÓÐÓû§¡£
ÒÔÉϾÍÊÇÉó²éLinuxϵͳÖеÄËùÓÐÓû§µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡