̽Ë÷LinuxÓû§IDµÄÎåÖÖ·ÖÀà
ÎÊÌ⣺ÉîÈëÏàʶLinuxÓû§IDµÄÎåÖÖ·ÖÀà
ÔÚLinux²Ù×÷ϵͳÖУ¬Ã¿¸öÓû§¶¼±»·ÖÅÉÒ»¸öΨһµÄÓû§ID£¨User ID£©£¬ÓÃÓÚ±êʶºÍÖÎÀíÓû§µÄȨÏ޺ͻá¼û¼¶±ð¡£Óû§IDµÄ·ÖÀà¹ØÓÚϵͳÖÎÀíºÍȨÏÞ¿ØÖƺÜÊÇÖ÷Òª¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÉîÈë̽ÌÖLinuxÓû§IDµÄÎåÖÖ·ÖÀ࣬²¢¸ø³öÏêϸµÄ´úÂëʾÀý¡£
Ò»¡¢ÕæÊÊÓû§ID£¨User ID£©
ÕæÊÊÓû§IDÊÇÓû§ÔÚϵͳÖеÄΨһ±êʶ£¬ÓÃÀ´Çø·Ö²î±ðµÄÓû§¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÄ¿½ñÓû§µÄÕæÊÊÓû§ID£º
$ echo $UID
µÇ¼ºó¸´ÖÆ
¶þ¡¢ÓÐÓÃÓû§ID£¨Effective User ID£©
ÓÐÓÃÓû§IDÓÃÓÚÈ·¶¨Óû§ÔÚÖ´ÐÐÏÂÁîʱËùÓµÓеÄȨÏÞ£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éÄ¿½ñÓû§µÄÓÐÓÃÓû§ID£º
$ id -u
µÇ¼ºó¸´ÖÆ
Èý¡¢ÉúÑĵÄÓû§ID£¨Saved User ID£©
ÉúÑĵÄÓû§IDÓÃÓÚÔÝʱÇл»Óû§È¨ÏÞ£¬Í¨³£ÔÚÐèÒªÖ´ÐÐÌØȨ²Ù×÷ʱʹÓ᣿ÉÒÔʹÓÃÒÔÏ´úÂëÀ´ÉèÖúͻָ´ÉúÑĵÄÓû§ID£º
$ sudo -u other_user command $ sudo -s
µÇ¼ºó¸´ÖÆ
ËÄ¡¢ÎļþËùÓÐÕßÓû§ID£¨File Owner User ID£©
ÎļþËùÓÐÕßÓû§IDÓÃÓÚ±êʶÎļþ»òĿ¼µÄËùÓÐÕߣ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÎļþµÄËùÓÐÕßÓû§ID£º
$ ls -l filename
µÇ¼ºó¸´ÖÆ
Îå¡¢ÌØȨÓû§ID£¨Super User ID£©
ÌØȨÓû§ID£¬Ò²³ÆΪ¸ùÓû§£¨root£©£¬ÓµÓÐϵͳÖÐ×î¸ßµÄȨÏÞºÍÌØȨ£¬¿ÉÒÔ¾ÙÐÐϵͳ¼¶±ðµÄ²Ù×÷¡£¿ÉÒÔʹÓÃÒÔÏ´úÂëÀÍÆÈ´»µ½ÌØȨÓû§£º
$ sudo su
µÇ¼ºó¸´ÖÆ
×ܽ᣺LinuxÓû§IDµÄÎåÖÖ·ÖÀàÔÚϵͳÖÎÀíºÍȨÏÞ¿ØÖÆÖÐÆð×ÅÖÁ¹ØÖ÷ÒªµÄ×÷Óã¬Í¨¹ýÏàʶÕâЩ·ÖÀàÒÔ¼°ÏìÓ¦µÄ´úÂëʾÀý£¬¿ÉÒÔ¸üºÃµØÕÆÎÕÓû§È¨ÏÞÖÎÀíµÄ¼¼ÇɺÍÒªÁì¡£
ͨ¹ý±¾ÎĵÄÏÈÈÝ£¬ÐÅÍжÁÕ߶ÔLinuxÓû§IDµÄ·ÖÀàÓÐÁ˸üÉîÈëµÄÏàʶ£¬Ï£ÍûÕâЩ´úÂëʾÀýÄܹ»×ÊÖúÄú¸üºÃµØÖÎÀíºÍ¿ØÖÆÓû§È¨ÏÞ¡£
ÒÔÉϾÍÊÇ̽Ë÷LinuxÓû§IDµÄÎåÖÖ·ÖÀàµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡