Ŀ¼Ë÷Òý
Ò»¡¢¶Ô³¬¼¶Óû§ºÍÆÕͨÓû§µÄÀí½â£»
1¡¢Ê²Ã´Êdz¬¼¶Óû§£»
2¡¢Àí½â UID ºÍÓû§µÄ¶ÔÓ¦¹Øϵ
3¡¢ÆÕͨÓû§ºÍαװÓû§
¶þ. ³¬¼¶Óû§£¨È¨ÏÞ£©ÔÚϵͳ¹ÜÀíÖеÄ×÷ÓÃ
1¡¢¶ÔÈκÎÎļþ¡¢Ä¿Â¼»ò½ø³Ì½øÐвÙ×÷£»
2¡¢¶ÔÓÚÉ漰ϵͳȫ¾ÖµÄϵͳ¹ÜÀí£»
3¡¢³¬¼¶È¨Ï޵IJ»¿ÉÌæ´úÐÔ£»
Èý¡¢Ê¹Óà su ÃüÁîÁÙʱÇл»Óû§Éí·Ý£»
1¡¢su µÄÊÊÓÃÌõ¼þºÍÍþÁ¦£»
2¡¢su µÄÓ÷¨£»
3¡¢su µÄ·¶Àý£»
4¡¢su µÄÓÅȱµã
ËÄ¡¢sudo ÊÚȨÐí¿ÉʹÓõÄsu£¬Ò²ÊÇÊÜÏÞÖƵÄsu
1. sudo µÄÊÊÓÃÌõ¼þ£»
2¡¢´Ó±àд sudo ÅäÖÃÎļþ/etc/sudoers¿ªÊ¼£»
3¡¢/etc/sudoers ÅäÖÃÎļþÖбðÃû¹æÔò
4¡¢/etc/sudoersÖеÄÊÚȨ¹æÔò£º
5¡¢/etc/sudoersÖÐÆäËüµÄδ¾¡ÊÂÏ
6¡¢sudoµÄÓ÷¨£»
Îå¡¢ºó¼Ç£»
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ÕýÎÄ
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ÔÚLinux²Ù×÷ϵͳÖУ¬rootµÄȨÏÞÊÇ×î¸ßµÄ£¬Ò²±»³ÆΪ³¬¼¶È¨ÏÞµÄÓµÓÐÕß¡£ÆÕͨÓû§ÎÞ·¨Ö´ÐеIJÙ×÷£¬rootÓû§¶¼ÄÜÍê³É£¬ËùÒÔÒ²±»³Æ֮Ϊ³¬¼¶¹ÜÀíÓû§¡£
ÔÚϵͳÖУ¬Ã¿¸öÎļþ¡¢Ä¿Â¼ºÍ½ø³Ì£¬¶¼¹éÊôÓÚijһ¸öÓû§£¬Ã»ÓÐÓû§Ðí¿ÉÆäËüÆÕͨÓû§ÊÇÎÞ·¨²Ù×÷µÄ£¬µ«¶Ôroot³ýÍâ¡£rootÓû§µÄÌØȨÐÔ»¹±íÏÖÔÚroot¿ÉÒÔ³¬Ô½ÈκÎÓû§ºÍÓû§×éÀ´¶ÔÎļþ»òĿ¼½øÐжÁÈ¡¡¢Ð޸Ļòɾ³ý£¨ÔÚϵͳÕý³£µÄÐí¿É·¶Î§ÄÚ£©£»¶Ô¿ÉÖ´ÐгÌÐòµÄÖ´ÐС¢ÖÕÖ¹£»¶ÔÓ²¼þÉ豸µÄÌí¼Ó¡¢´´½¨ºÍÒƳýµÈ£»Ò²¿ÉÒÔ¶ÔÎļþºÍĿ¼½øÐÐÊôÖ÷ºÍȨÏÞ½øÐÐÐ޸ģ¬ÒÔÊʺÏϵͳ¹ÜÀíµÄÐèÒª£¨ÒòΪrootÊÇϵͳÖÐȨÏÞ×î¸ßµÄÌØȨÓû§£©£»
Ò»¡¢¶Ô³¬¼¶Óû§ºÍÆÕͨÓû§µÄÀí½â£»
1¡¢Ê²Ã´Êdz¬¼¶Óû§£»
ÔÚËùÓÐLinuxϵͳÖУ¬ÏµÍ³¶¼ÊÇͨ¹ýUIDÀ´Çø·ÖÓû§È¨ÏÞ¼¶±ðµÄ£¬¶øUIDΪ0µÄÓû§±»ÏµÍ³Ô¼¶¨ÎªÊǾßÓг¬¼¶È¨ÏÞ¡£³¬¼¶Óû§¾ßÓÐÔÚϵͳԼ¶¨µÄ×î¸ßȨÏÞÂúÔ°ÄÚ²Ù×÷£¬ËùÒÔ˵³¬¼¶Óû§¿ÉÒÔÍê³Éϵͳ¹ÜÀíµÄËùÓй¤¾ß£»ÎÒÃÇ¿ÉÒÔͨ¹ý/etc/passwd À´²éµÃUIDΪ0µÄÓû§ÊÇroot£¬¶øÇÒÖ»ÓÐroot¶ÔÓ¦µÄUIDΪ0£¬´ÓÕâÒ»µãÀ´¿´£¬rootÓû§ÔÚϵͳÖÐÊÇÎÞ¿ÉÌæ´úµÄÖÁ¸ßµØλºÍÎÞÏÞÖÆȨÏÞ¡£rootÓû§ÔÚϵͳÖоÍÊdz¬¼¶Óû§£»
2¡¢Àí½â UID ºÍÓû§µÄ¶ÔÓ¦¹Øϵ
µ±ÏµÍ³Ä¬ÈÏ°²×°Ê±£¬ÏµÍ³Óû§ºÍUID ÊÇÒ»¶ÔÒ»µÄ¶Ô¹Øϵ£¬Ò²¾ÍÊÇ˵һ¸öUID ¶ÔÓ¦Ò»¸öÓû§¡£ÎÒÃÇÖªµÀÓû§Éí·ÝÊÇͨ¹ýUID À´È·Èϵģ¬ÎÒÃÇÔÚ ¡¶Óû§£¨user£©ºÍÓû§×飨group£©ÅäÖÃÎļþÏê½â¡·ÖеÄUID µÄ½â˵ÖÐÓÐ̸µ½¡°UID ÊÇÈ·ÈÏÓû§È¨Ï޵ıêʶ£¬Óû§µÇ¼ϵͳËù´¦µÄ½ÇÉ«ÊÇͨ¹ýUID À´ÊµÏֵģ¬¶ø·ÇÓû§Ãû£»°Ñ¼¸¸öÓû§¹²ÓÃÒ»¸öUID ÊÇΣÏյģ¬±ÈÈçÎÒÃÇ°ÑÆÕͨÓû§µÄUID ¸ÄΪ0£¬ºÍroot¹²ÓÃÒ»¸öUID £¬ÕâÊÂʵÉϾÍÔì³ÉÁËϵͳ¹ÜÀíȨÏ޵ĻìÂÒ¡£Èç¹ûÎÒÃÇÏëÓÃrootȨÏÞ£¬¿ÉÒÔͨ¹ýsu»òsudoÀ´ÊµÏÖ£»Çв»¿ÉËæÒâÈÃÒ»¸öÓû§ºÍroot·ÖÏíͬһ¸öUID £»¡±
ÔÚϵͳÖУ¬Äܲ»ÄÜÈÃUID ºÍÓû§ÊÇÒ»¶Ô¶àµÄ¹Øϵ£¿ÊÇ¿ÉÒԵģ¬±ÈÈçÎÒÃÇ¿ÉÒÔ°ÑÒ»¸öUIDΪ0Õâ¸öÖµ·ÖÅä¸ø¼¸¸öÓû§¹²Í¬Ê¹Óã¬Õâ¾ÍÊÇUID ºÍÓû§µÄÒ»¶Ô¶àµÄ¹Øϵ¡£µ«ÕâÑù×öµÄÈ·ÓеãΣÏÕ£»ÏàͬUIDµÄÓû§¾ßÓÐÏàͬµÄÉí·ÝºÍȨÏÞ¡£±ÈÈçÎÒÃÇÔÚϵͳÖаÑbeinanÕâ¸öÆÕͨÓû§µÄUID¸ÄΪ0ºó£¬ÊÂʵÉÏÕâ¸öÆÕͨÓû§¾Í¾ßÓÐÁ˳¬¼¶È¨ÏÞ£¬ËûµÄÄÜÁ¦ºÍȨÏÞºÍrootÓû§Ò»Ñù£»Óû§beinanËùÓеIJÙ×÷¶¼½«±»±êʶΪrootµÄ²Ù×÷£¬ÒòΪbeinanµÄUIDΪ0,¶øUIDΪ0µÄÓû§ÊÇroot £¬ÊDz»ÊÇÓеãÈÅ¿Ú£¿Ò²¿ÉÒÔÀí½âΪUIDΪ0µÄÓû§¾ÍÊÇroot £¬rootÓû§µÄUID¾ÍÊÇ0£»
UIDºÍÓû§µÄÒ»¶ÔÒ»µÄ¶ÔÓ¦¹Øϵ £¬Ö»ÊÇÒªÇó¹ÜÀíÔ±½øÐÐϵͳ¹ÜÀíʱ£¬ËùÒª¼áÊصÄ×¼Ôò£¬ÒòΪϵͳ°²È«»¹ÊǵÚһλµÄ¡£ËùÒÔÎÒÃÇ»¹Êǰѳ¬¼¶È¨ÏÞ±£Áô¸ørootÕâΨһµÄÓû§ÊÇ×îºÃµÄÑ¡Ôñ£»
Èç¹ûÎÒÃDz»°ÑUIDµÄ0ÖµµÄ·ÖÏí¸øÆäËüÓû§Ê¹Óã¬Ö»ÓÐrootÓû§ÊÇΨһӵÓÐUID=0µÄ»°£¬rootÓû§¾ÍÊÇΨһµÄ³¬¼¶È¨ÏÞÓû§£»
3¡¢ÆÕͨÓû§ºÍαװÓû§
Ó볬¼¶Óû§Ïà¶ÔµÄ¾ÍÊÇÆÕͨÓû§ºÍÐéÄ⣨Ҳ±»³ÆΪαװÓû§£©£¬ÆÕͨºÍαװÓû§¶¼ÊÇÊÜÏÞÓû§£»µ«ÎªÁËÍê³ÉÌض¨µÄÈÎÎñ£¬ÆÕͨÓû§ºÍαװÓû§Ò²ÊDZØÐëµÄ£»LinuxÊÇÒ»¸ö¶àÓû§¡¢¶àÈÎÎñµÄ²Ù×÷ϵͳ£¬¶àÓû§Ö÷ÒªÌåÏÖÔÚÓû§µÄ½ÇÉ«µÄ¶àÑùÐÔ£¬²»Í¬µÄÓû§Ëù·ÖÅäµÄȨÏÞÒ²²»Í¬£»ÕâÒ²ÊÇLinuxϵͳ±ÈWindowsϵͳ¸üΪ°²È«µÄ±¾ÖÊËùÔÚ£¬¼´Ê¹ÊÇÏÖÔÚ×îа汾µÄWindows 2003 £¬Ò²ÎÞ·¨Ä¨È¥Æäµ¥Óû§ÏµÍ³µÄÀÓÓ¡£»
¶þ. ³¬¼¶Óû§£¨È¨ÏÞ£©ÔÚϵͳ¹ÜÀíÖеÄ×÷ÓÃ
³¬¼¶È¨ÏÞÓû§£¨UIDΪ0µÄÓû§£©µ½µ×ÔÚϵͳ¹ÜÀíÖÐÆðʲô×÷ÓÃÄØ£¿Ö÷Òª±íÏÖÔÚÒÔÏÂÁ½µã£»
1¡¢¶ÔÈκÎÎļþ¡¢Ä¿Â¼»ò½ø³Ì½øÐвÙ×÷£»
µ«ÖµµÃ×¢ÒâµÄÊÇÕâÖÖ²Ù×÷ÊÇÔÚϵͳ×î¸ßÐí¿É·¶Î§ÄڵIJÙ×÷£»ÓÐЩ²Ù×÷¾ÍÊǾßÓг¬¼¶È¨ÏÞµÄrootÒ²ÎÞ·¨Íê³É£»
±ÈÈç/proc Ŀ¼£¬/proc ÊÇÓÃÀ´·´Ó¦ÏµÍ³ÔËÐеÄʵʱ״̬ÐÅÏ¢µÄ£¬Òò´Ë¼´±ãÊÇrootÒ²ÎÞÄÜΪÁ¦£»ËüµÄȨÏÞÈçÏÂ
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd /
[root@localhost /]# ls -ld /proc/
dr-xr-xr-x 134 root root 0 2005-10-27 /proc/
¾ÍÊÇÕâ¸öĿ¼£¬Ö»ÄÜÊǶÁºÍÖ´ÐÐȨÏÞ£¬µ«¾ø¶ÔûÓÐдȨÏ޵ģ»¾ÍÊÇÎÒÃÇ°Ñ/proc Ŀ¼µÄдȨÏÞ´ò¿ª¸øroot£¬rootÓû§Ò²ÊDz»ÄܽøÐÐд²Ù×÷£»
[root@localhost ~]# chmod 755 /proc
[root@localhost /]# ls -ld /proc/
drwxr-xr-x 134 root root 0 2005-10-27 /proc/
[root@localhost /]# cd /proc/
[root@localhost proc]# mkdir testdir
mkdir: ÎÞ·¨´´½¨Ä¿Â¼¡®testdir¡¯: ûÓÐÄǸöÎļþ»òĿ¼
2¡¢¶ÔÓÚÉ漰ϵͳȫ¾ÖµÄϵͳ¹ÜÀí£»
Ó²¼þ¹ÜÀí¡¢ÎļþϵͳÀí½â¡¢Óû§¹ÜÀíÒÔ¼°Éæ¼°µ½µÄϵͳȫ¾ÖÅäÖõȵÈ......Èç¹ûÄúÖ´ÐÐij¸öÃüÁî»ò¹¤¾ßʱ£¬ÌáʾÄúÎÞȨÏÞ£¬´ó¶àÊÇÐèÒª³¬¼¶È¨ÏÞÀ´Íê³É£»
±ÈÈçÓÃadduserÀ´Ìí¼ÓÓû§£¬Õâ¸öÖ»ÄÜÓÃͨ¹ý³¬¼¶È¨ÏÞµÄÓû§À´Íê³É£»
3¡¢³¬¼¶È¨Ï޵IJ»¿ÉÌæ´úÐÔ£»
ÓÉÓÚ³¬¼¶È¨ÏÞÔÚϵͳ¹ÜÀíÖеIJ»¿ÉȱÉÙµÄÖØÒª×÷Óã¬ÎªÁËÍê³Éϵͳ¹ÜÀíÈÎÎñ£¬ÎÒÃDZØÐëÓõ½³¬¼¶È¨ÏÞ£»ÔÚÒ»°ãÇé¿öÏ£¬ÎªÁËϵͳ°²È«£¬¶ÔÓÚÒ»°ã³£¹æ¼¶±ðµÄÓ¦Ó㬲»ÐèÒªrootÓû§À´²Ù×÷Íê³É£¬rootÓû§Ö»ÊDZ»ÓÃÀ´¹ÜÀíºÍά»¤ÏµÍ³Ö®Óã»±ÈÈçϵͳÈÕÖ¾µÄ²é¿´¡¢ÇåÀí£¬Óû§µÄÌí¼ÓºÍɾ³ý......
ÔÚ²»É漰ϵͳ¹ÜÀíµÄ¹¤×÷µÄ»·¾³Ï£¬ÆÕͨÓû§×ã¿ÉÒÔÍê³É£¬±ÈÈç±àдһ¸öÎļþ£¬ÌýÌýÒôÀÖ£»ÓÃgimp ´¦ÀíÒ»¸öͼƬµÈ...... »ùÓÚÆÕͨӦÓóÌÐòµÄµ÷Ó㬴ó¶àÆÕͨÓû§¾Í¿ÉÒÔÍê³É£»
µ±ÎÒÃÇÒÔÆÕͨȨÏÞµÄÓû§µÇ¼ϵͳʱ£¬ÓÐЩϵͳÅäÖü°ÏµÍ³¹ÜÀí±ØÐëͨ¹ý³¬¼¶È¨ÏÞÓû§Íê³É£¬±ÈÈç¶ÔϵͳÈÕÖ¾µÄ¹ÜÀí£¬Ìí¼ÓºÍɾ³ýÓû§¡£¶øÈçºÎ²ÅÄܲ»Ö±½ÓÒÔrootµÇ¼£¬È´ÄÜ´ÓÆÕͨÓû§Çл»µ½rootÓû§Ï²ÅÄܽøÐвÙ×÷ϵͳ¹ÜÀíÐèÒªµÄ¹¤×÷£¬Õâ¾ÍÉæ¼°µ½³¬¼¶È¨ÏÞ¹ÜÀíµÄÎÊÌ⣻
»ñÈ¡³¬¼¶È¨Ï޵Ĺý³Ì£¬¾ÍÊÇÇл»ÆÕͨÓû§Éí·Ýµ½³¬¼¶Óû§Éí·ÝµÄ¹ý³Ì£»Õâ¸ö¹ý³ÌÖ÷ÒªÊÇͨ¹ýsuºÍsudo À´½â¾ö£»
Èý¡¢Ê¹Óà su ÃüÁîÁÙʱÇл»Óû§Éí·Ý£»
1¡¢su µÄÊÊÓÃÌõ¼þºÍÍþÁ¦
suÃüÁî¾ÍÊÇÇл»Óû§µÄ¹¤¾ß£¬ÔõôÀí½âÄØ£¿±ÈÈçÎÒÃÇÒÔÆÕͨÓû§beinanµÇ¼µÄ£¬µ«ÒªÌí¼ÓÓû§ÈÎÎñ£¬Ö´ÐÐuseradd £¬beinanÓû§Ã»ÓÐÕâ¸öȨÏÞ£¬¶øÕâ¸öȨÏÞÇ¡Ç¡ÓÉrootËùÓµÓС£½â¾ö°ì·¨ÎÞ·¨ÓÐÁ½¸ö£¬Ò»ÊÇÍ˳öbeinanÓû§£¬ÖØÐÂÒÔrootÓû§µÇ¼£¬µ«ÕâÖÖ°ì·¨²¢²»ÊÇ×îºÃµÄ£»¶þÊÇÎÒÃÇûÓбØÒªÍ˳öbeinanÓû§£¬¿ÉÒÔÓÃsuÀ´Çл»µ½rootϽøÐÐÌí¼ÓÓû§µÄ¹¤×÷£¬µÈÈÎÎñÍê³ÉºóÔÙÍ˳öroot¡£ÎÒÃÇ¿ÉÒÔ¿´µ½µ±È»Í¨¹ýsu Çл»ÊÇÒ»ÖֱȽϺõİ취£»
ͨ¹ýsu¿ÉÒÔÔÚÓû§Ö®¼äÇл»£¬Èç¹û³¬¼¶È¨ÏÞÓû§rootÏòÆÕͨ»òÐéÄâÓû§Çл»²»ÐèÒªÃÜÂ룬ʲôÊÇȨÁ¦£¿Õâ¾ÍÊÇ£¡¶øÆÕͨÓû§Çл»µ½ÆäËüÈκÎÓû§¶¼ÐèÒªÃÜÂëÑéÖ¤£»
2¡¢su µÄÓ÷¨£º
su [OPTIONÑ¡Ïî²ÎÊý] [Óû§]
-, -l, --login µÇ¼²¢¸Ä±äµ½ËùÇл»µÄÓû§»·¾³£»
-c, --commmand=COMMAND Ö´ÐÐÒ»¸öÃüÁȻºóÍ˳öËùÇл»µ½µÄÓû§»·¾³£»
ÖÁÓÚ¸üÏêϸµÄ£¬Çë²Î¿´man su £»
3¡¢su µÄ·¶Àý£º
su ÔÚ²»¼ÓÈκβÎÊý£¬Ä¬ÈÏΪÇл»µ½rootÓû§£¬µ«Ã»ÓÐתµ½rootÓû§¼ÒĿ¼Ï£¬Ò²¾ÍÊÇ˵ÕâʱËäÈ»ÊÇÇл»ÎªrootÓû§ÁË£¬µ«²¢Ã»ÓиıärootµÇ¼»·¾³£»Óû§Ä¬ÈϵĵǼ»·¾³£¬¿ÉÒÔÔÚ/etc/passwd ÖвéµÃµ½£¬°üÀ¨¼ÒĿ¼£¬SHELL¶¨ÒåµÈ£»
[beinan@localhost ~]$ su
Password:
[root@localhost beinan]# pwd
/home/beinan
su ¼Ó²ÎÊý - £¬±íʾĬÈÏÇл»µ½rootÓû§£¬²¢ÇҸı䵽rootÓû§µÄ»·¾³£»
[beinan@localhost ~]$ pwd
/home/beinan
[beinan@localhost ~]$ su -
Password:
[root@localhost ~]# pwd
/root
su ²ÎÊý - Óû§Ãû
[beinan@localhost ~]$ su - root ×¢£ºÕâ¸öºÍsu - ÊÇÒ»ÑùµÄ¹¦ÄÜ£»
Password:
[root@localhost ~]# pwd
/root
[beinan@localhost ~]$ su - linuxsir ×¢£ºÕâÊÇÇл»µ½ linuxsirÓû§
Password: ×¢£ºÔÚÕâÀïÊäÈëÃÜÂ룻
[linuxsir@localhost ~]$ pwd ×¢£º²é¿´Óû§µ±Ç°Ëù´¦µÄλÖã»
/home/linuxsir
[linuxsir@localhost ~]$ id ×¢£º²é¿´Óû§µÄUIDºÍGIDÐÅÏ¢£¬Ö÷ÒªÊÇ¿´ÊÇ·ñÇл»¹ýÀ´ÁË£»
uid=505(linuxsir) gid=502(linuxsir) groups=0(root),500(beinan),502(linuxsir)
[linuxsir@localhost ~]$
[beinan@localhost ~]$ su - -c ls ×¢£ºÕâÊÇsuµÄ²ÎÊý×éºÏ£¬±íʾÇл»µ½rootÓû§£¬²¢ÇҸı䵽root»·¾³£¬È»ºóÁгöroot¼ÒĿ¼µÄÎļþ£¬È»ºóÍ˳örootÓû§£»
Password: ×¢£ºÔÚÕâÀïÊäÈërootµÄÃÜÂ룻
anaconda-ks.cfg Desktop install.log install.log.syslog testgroup testgroupbeinan testgrouproot
[beinan@localhost ~]$ pwd ×¢£º²é¿´µ±Ç°Óû§Ëù´¦µÄλÖã»
/home/beinan
[beinan@localhost ~]$ id ×¢£º²é¿´µ±Ç°Óû§ÐÅÏ¢£»
uid=500(beinan) gid=500(beinan) groups=500(beinan)
4¡¢suµÄÓÅȱµã£»
su µÄȷΪ¹ÜÀí´øÀ´·½±ã£¬Í¨¹ýÇл»µ½rootÏ£¬ÄÜÍê³ÉËùÓÐϵͳ¹ÜÀí¹¤¾ß£¬Ö»Òª°ÑrootµÄÃÜÂë½»¸øÈκÎÒ»¸öÆÕͨÓû§£¬Ëû¶¼ÄÜÇл»µ½rootÀ´Íê³ÉËùÓеÄϵͳ¹ÜÀí¹¤×÷£»
µ«Í¨¹ýsuÇл»µ½rootºó£¬Ò²Óв»°²È«ÒòËØ£»±ÈÈçϵͳÓÐ10¸öÓû§£¬¶øÇÒ¶¼²ÎÓë¹ÜÀí¡£Èç¹ûÕâ10¸öÓû§¶¼Éæ¼°µ½³¬¼¶È¨ÏÞµÄÔËÓã¬×öΪ¹ÜÀíÔ±Èç¹ûÏëÈÃÆäËüÓû§Í¨¹ýsuÀ´Çл»µ½³¬¼¶È¨ÏÞµÄroot£¬±ØÐë°ÑrootȨÏÞÃÜÂ붼¸æËßÕâ10¸öÓû§£»Èç¹ûÕâ10¸öÓû§¶¼ÓÐrootȨÏÞ£¬Í¨¹ýrootȨÏÞ¿ÉÒÔ×öÈκÎÊ£¬ÕâÔÚÒ»¶¨³Ì¶ÈÉϾͶÔϵͳµÄ°²È«Ôì³ÉÁËÍþУ»ÏëÏëWindows°É£¬¼òÖ±¾ÍÊǶñÃΣ»
¡°Ã»Óв»°²È«µÄϵͳ£¬Ö»Óв»°²È«µÄÈË¡±£¬ÎÒÃǾø¶Ô²»Äܱ£Ö¤Õâ10¸öÓû§¶¼ÄÜ°´Õý³£²Ù×÷Á÷³ÌÀ´¹ÜÀíϵͳ£¬ÆäÖÐÈκÎÒ»È˶Ôϵͳ²Ù×÷µÄÖØ´óʧÎ󣬶¼¿ÉÄܵ¼ÖÂϵͳ±ÀÀ£»òÊý¾ÝËðʧ£»
ËùÒÔsu ¹¤¾ßÔÚ¶àÈ˲ÎÓëµÄϵͳ¹ÜÀíÖУ¬²¢²»ÊÇ×îºÃµÄÑ¡Ôñ£¬suÖ»ÊÊÓÃÓÚÒ»Á½¸öÈ˲ÎÓë¹ÜÀíµÄϵͳ£¬±Ï¾¹su²¢²»ÄÜÈÃÆÕͨÓû§ÊÜÏÞµÄʹÓã»
³¬¼¶Óû§rootÃÜÂëÓ¦¸ÃÕÆÎÕÔÚÉÙÊýÓû§ÊÖÖУ¬Õâ¾ø¶ÔÊÇÕæÀí£¡ËùÒÔ¼¯È¨¶øÖεĴæÔÚ»¹ÊÇÓÐÒ»¶¨µÀÀíµÄ£»
ËÄ¡¢sudo ÊÚȨÐí¿ÉʹÓõÄsu£¬Ò²ÊÇÊÜÏÞÖƵÄsu
1. sudo µÄÊÊÓÃÌõ¼þ£»
ÓÉÓÚsu ¶ÔÇл»µ½³¬¼¶È¨ÏÞÓû§rootºó£¬È¨ÏÞµÄÎÞÏÞÖÆÐÔ£¬ËùÒÔsu²¢²»Äܵ£Èζà¸ö¹ÜÀíÔ±Ëù¹ÜÀíµÄϵͳ¡£Èç¹ûÓÃsu À´Çл»µ½³¬¼¶Óû§À´¹ÜÀíϵͳ£¬Ò²²»ÄÜÃ÷È·ÄÄЩ¹¤×÷ÊÇÓÉÄĸö¹ÜÀíÔ±½øÐеIJÙ×÷¡£ÌرðÊǶÔÓÚ·þÎñÆ÷µÄ¹ÜÀíÓжàÈ˲ÎÓë¹ÜÀíʱ£¬×îºÃÊÇÕë¶Ôÿ¸ö¹ÜÀíÔ±µÄ¼¼ÊõÌس¤ºÍ¹ÜÀí·¶Î§£¬²¢ÇÒÓÐÕë¶ÔÐÔµÄÏ·ŸøȨÏÞ£¬²¢ÇÒÔ¼¶¨ÆäʹÓÃÄÄЩ¹¤¾ßÀ´Íê³ÉÓëÆäÏà¹ØµÄ¹¤×÷£¬ÕâʱÎÒÃǾÍÓбØÒªÓõ½ sudo¡£
ͨ¹ýsudo£¬ÎÒÃÇÄÜ°ÑijЩ³¬¼¶È¨ÏÞÓÐÕë¶ÔÐÔµÄÏ·ţ¬²¢ÇÒ²»ÐèÒªÆÕͨÓû§ÖªµÀrootÃÜÂ룬ËùÒÔsudo Ïà¶ÔÓÚȨÏÞÎÞÏÞÖÆÐÔµÄsuÀ´Ëµ£¬»¹ÊDZȽϰ²È«µÄ£¬ËùÒÔsudo Ò²Äܱ»³ÆΪÊÜÏÞÖƵÄsu £»ÁíÍâsudo ÊÇÐèÒªÊÚȨÐí¿ÉµÄ£¬ËùÒÔÒ²±»³ÆΪÊÚȨÐí¿ÉµÄsu£»
sudo Ö´ÐÐÃüÁîµÄÁ÷³ÌÊǵ±Ç°Óû§Çл»µ½root£¨»òÆäËüÖ¸¶¨Çл»µ½µÄÓû§£©£¬È»ºóÒÔroot£¨»òÆäËüÖ¸¶¨µÄÇл»µ½µÄÓû§£©Éí·ÝÖ´ÐÐÃüÁִÐÐÍê³Éºó£¬Ö±½ÓÍ˻ص½µ±Ç°Óû§£»¶øÕâЩµÄÇ°ÌáÊÇҪͨ¹ýsudoµÄÅäÖÃÎļþ/etc/sudoersÀ´½øÐÐÊÚȨ£»
2¡¢´Ó±àд sudo ÅäÖÃÎļþ/etc/sudoers¿ªÊ¼£»
sudoµÄÅäÖÃÎļþÊÇ/etc/sudoers £¬ÎÒÃÇ¿ÉÒÔÓÃËûµÄרÓñ༹¤¾ßvisodu £¬´Ë¹¤¾ßµÄºÃ´¦ÊÇÔÚÌí¼Ó¹æÔò²»Ì«×¼È·Ê±£¬±£´æÍ˳öʱ»áÌáʾ¸øÎÒÃÇ´íÎóÐÅÏ¢£»ÅäÖúú󣬿ÉÒÔÓÃÇл»µ½ÄúÊÚȨµÄÓû§Ï£¬Í¨¹ýsudo -l À´²é¿´ÄÄЩÃüÁîÊÇ¿ÉÒÔÖ´Ðлò½ûÖ¹µÄ£»
/etc/sudoers ÎļþÖÐÿÐÐËãÒ»¸ö¹æÔò£¬Ç°Ãæ´øÓÐ#ºÅ¿ÉÒÔµ±×÷ÊÇ˵Ã÷µÄÄÚÈÝ£¬²¢²»Ö´ÐУ»Èç¹û¹æÔòºÜ³¤£¬Ò»ÐÐÁв»ÏÂʱ£¬¿ÉÒÔÓÃ\ºÅÀ´ÐøÐУ¬ÕâÑù¿´À´Ò»¸ö¹æÔòÒ²¿ÉÒÔÓµÓжà¸öÐУ»
/etc/sudoers µÄ¹æÔò¿É·ÖΪÁ½ÀࣻһÀàÊDZðÃû¶¨Ò壬ÁíÒ»ÀàÊÇÊÚȨ¹æÔò£»±ðÃû¶¨Òå²¢²»ÊDZØÐëµÄ£¬µ«ÊÚȨ¹æÔòÊDZØÐëµÄ£»
3¡¢/etc/sudoers ÅäÖÃÎļþÖбðÃû¹æÔò
±ðÃû¹æÔò¶¨Òå¸ñʽÈçÏ£º
Alias_Type NAME = item1, item2, ...
»ò
Alias_Type NAME = item1, item2, item3 : NAME = item4, item5
±ðÃûÀàÐÍ£¨Alias_Type£©£º±ðÃûÀàÐÍ°üÀ¨ÈçÏÂËÄÖÖ
Host_Alias ¶¨ÒåÖ÷»ú±ðÃû£»
User_Alias Óû§±ðÃû£¬±ðÃû³ÉÔ±¿ÉÒÔÊÇÓû§£¬Óû§×飨ǰÃæÒª¼Ó%ºÅ£©
Runas_Alias ÓÃÀ´¶¨Òårunas±ðÃû£¬Õâ¸ö±ðÃûÖ¸¶¨µÄÊÇ¡°Ä¿µÄÓû§¡±£¬¼´sudo ÔÊÐíÇл»ÖÁµÄÓû§£»
Cmnd_Alias ¶¨ÒåÃüÁî±ðÃû£»
NAME ¾ÍÊDZðÃûÁË£¬NMAEµÄÃüÃûÊÇ°üº¬´óд×Öĸ¡¢Ï»®ÏßÒÔ¼°Êý×Ö£¬µ«±ØÐëÒÔÒ»¸ö´óд×Öĸ¿ªÍ·£¬±ÈÈçSYNADM¡¢SYN_ADM»òSYNAD0ÊǺϷ¨µÄ£¬sYNAMDA»ò1SYNADÊDz»ºÏ·¨µÄ£»
item °´ÖÐÎÄ·ÒëÊÇÏîÄ¿£¬ÔÚÕâÀïÎÒÃÇ¿ÉÒÔÒë³É³ÉÔ±£¬Èç¹ûÒ»¸ö±ðÃûÏÂÓжà¸ö³ÉÔ±£¬³ÉÔ±Óë³ÉÔ±Ö®¼ä£¬Í¨¹ý°ë½Ç,ºÅ·Ö¸ô£»³ÉÔ±ÔÚ±ØÐëÊÇÓÐЧ²¢ÊÂʵ´æÔڵġ£Ê²Ã´ÊÇÓÐЧµÄÄØ£¿±ÈÈçÖ÷»úÃû£¬¿ÉÒÔͨ¹ýw²é¿´Óû§µÄÖ÷»úÃû£¨»òipµØÖ·£©£¬Èç¹ûÄúÖ»ÊDZ¾µØ»ú²Ù×÷£¬Ö»Í¨¹ýhostname ÃüÁî¾ÍÄܲ鿴£»Óû§Ãûµ±È»ÊÇÔÚϵͳÖдæÔڵģ¬ÔÚ/etc/paswdÖбØÐë´æÔÚ£»¶ÔÓÚ¶¨ÒåÃüÁî±ðÃû£¬³ÉÔ±Ò²±ØÐëÔÚϵͳÖÐÊÂʵ´æÔÚµÄÎļþÃû£¨ÐèÒª¾ø¶Ô·¾¶£©£»
item³ÉÔ±ÊܱðÃûÀàÐÍ Host_Alias¡¢User_Alias¡¢Runas_Alias¡¢Cmnd_Alias ÖÆÔ¼£¬¶¨ÒåʲôÀàÐ͵ıðÃû£¬¾ÍÒªÓÐʲôÀàÐ͵ijÉÔ±ÏàÅä¡£ÎÒÃÇÓÃHost_Alias¶¨ÒåÖ÷»ú±ðÃûʱ£¬³ÉÔ±±ØÐëÊÇÓëÖ÷»úÏà¹ØÏà¹ØÁª£¬±ÈÈçÊÇÖ÷»úÃû£¨°üÀ¨Ô¶³ÌµÇ¼µÄÖ÷»úÃû£©¡¢ipµØÖ·£¨µ¥¸ö»òÕû¶Î£©¡¢ÑÚÂëµÈ£»µ±Óû§µÇ¼ʱ£¬¿ÉÒÔͨ¹ýwÃüÁîÀ´²é¿´µÇ¼Óû§Ö÷»úÐÅÏ¢£»ÓÃUser_AliasºÍRunas_Alias¶¨Òåʱ£¬±ØÐëÒªÓÃϵͳÓû§×öΪ³ÉÔ±£»ÓÃCmnd_Alias ¶¨ÒåÖ´ÐÐÃüÁîµÄ±ðÃûʱ£¬±ØÐëÊÇϵͳ´æÔÚµÄÎļþ£¬ÎļþÃû¿ÉÒÔÓÃͨÅä·û±íʾ£¬ÅäÖÃCmnd_AliasʱÃüÁîÐèÒª¾ø¶Ô·¾¶£»
ÆäÖÐ Runas_Alias ºÍUser_Alias ÓеãÏàËÆ£¬µ«ÓëUser_Alias ¾ø¶Ô²»ÊÇͬһ¸ö¸ÅÄRunas_Alias ¶¨ÒåµÄÊÇij¸öϵͳÓû§¿ÉÒÔsudo Çл»Éí·Ýµ½Runas_Alias ϵijÉÔ±£»ÎÒÃÇÔÚÊÚȨ¹æÔòÖÐÒÔʵÀý½øÐнâ˵£»
±ðÃû¹æÔòÊÇÿÐÐËãÒ»¸ö¹æÔò£¬Èç¹ûÒ»¸ö±ðÃû¹æÔòÒ»ÐÐÈݲ»ÏÂʱ£¬¿ÉÒÔͨ¹ý\À´ÐøÐУ»Í¬Ò»ÀàÐͱðÃûµÄ¶¨Ò壬һ´ÎÒ²¿ÉÒÔ¶¨Ò弸¸ö±ðÃû£¬ËûÃÇÖмäÓÃ:ºÅ·Ö¸ô£¬
Host_Alias HT01=localhost,st05,st04,10,0,0,4,255.255.255.0,192.168.1.0/24 ×¢£º¶¨ÒåÖ÷»ú±ðÃûHT01£¬Í¨¹ý=ºÅÁгö³ÉÔ±
Host_Alias HT02=st09,st10 ×¢£ºÖ÷»ú±ðÃûHT02£¬ÓÐÁ½¸ö³ÉÔ±£»
Host_Alias HT01=localhost,st05,st04,10,0,0,4,255.255.255.0,192.168.1.0/24:HT02=st09,st10 ×¢£ºÉÏÃæµÄÁ½Ìõ¶ÔÖ÷»úµÄ¶¨Ò壬¿ÉÒÔͨ¹ýÒ»ÌõÀ´ÊµÏÖ£¬±ðÃûÖ®¼äÓÃ:ºÅ·Ö¸î£»
×¢£ºÎÒÃÇͨ¹ýHost_Alias ¶¨ÒåÖ÷»ú±ðÃûʱ£¬ÏîÄ¿¿ÉÒÔÊÇÖ÷»úÃû¡¢¿ÉÒÔÊǵ¥¸öip£¨Õû¶ÎipµØÖ·Ò²¿ÉÒÔ£©£¬Ò²¿ÉÒÔÊÇÍøÂçÑÚÂ룻Èç¹ûÊÇÖ÷»úÃû£¬±ØÐëÊǶą̀»úÆ÷µÄÍøÂçÖУ¬¶øÇÒÕâЩ»úÆ÷µÃÄÜͨ¹ýÖ÷»úÃûÏ໥ͨÐÅ·ÃÎʲÅÓÐЧ¡£ÄÇʲô²ÅËãÊÇͨ¹ýÖ÷»úÃûÏ໥ͨÐÅ»ò·ÃÎÊÄØ£¿±ÈÈç ping Ö÷»úÃû£¬»òͨ¹ýÔ¶³Ì·ÃÎÊÖ÷»úÃûÀ´·ÃÎÊ¡£ÔÚÎÒÃǾÖÓòÍøÖУ¬Èç¹ûÈüÆËã»úͨ¹ýÖ÷»úÃû·ÃÎÊͨÐÅ£¬±ØÐëÉèÖÃ/etc/hosts£¬/etc/resolv.conf £¬»¹ÒªÓÐDNS×ö½âÎö£¬·ñÔòÏ໥֮¼äÎÞ·¨Í¨¹ýÖ÷»úÃû·ÃÎÊ£»ÔÚÉèÖÃÖ÷»ú±ðÃûʱ£¬Èç¹ûÏîÄ¿ÊÇÖÐij¸öÏîÄ¿ÊÇÖ÷»úÃûµÄ»°£¬¿ÉÒÔͨ¹ýhostname ÃüÁîÀ´²é¿´±¾µØÖ÷»úµÄÖ÷»úÃû£¬Í¨¹ýwÃüÁî²éÀ´¿´µÇ¼Ö÷»úÊÇÀ´Ô´£¬Í¨¹ýÀ´Ô´À´È·ÈÏÆäËü¿Í»§»úµÄÖ÷»úÃû»òipµØÖ·£»¶ÔÓÚÖ÷»ú±ðÃûµÄ¶¨Ò壬¿´ÉÏÈ¥Óе㸴ÔÓ£¬ÆäʵÊǺܼòµ¥¡£
Èç¹ûÄú²»Ã÷°×Host_Alias ÊÇÔõô»ØÊ£¬Ò²¿ÉÒÔ²»ÓÃÉèÖÃÖ÷»ú±ðÃû£¬ÔÚ¶¨ÒåÊÚȨ¹æÔòʱͨ¹ýALLÀ´Æ¥ÅäËùÓпÉÄܳöÏÖµÄÖ÷»úÇé¿ö¡£Èç¹ûÄú°ÑÖ÷»ú·½ÃæµÄ֪ʶŪµÄ¸üÃ÷°×£¬µÄÈ·ÐèÒª¶à¶àѧϰ¡£
User_Alias SYSAD=beinan,linuxsir,bnnnb,lanhaitun ×¢£º¶¨ÒåÓû§±ðÃû£¬ÏÂÓÐËĸö³ÉÔ±£»ÒªÔÚϵͳÖÐȷʵÔÚ´æÔڵģ»
User_Alias NETAD=beinan,bnnb ×¢£º¶¨ÒåÓû§±ðÃûNETAD £¬ÎÒÏëÈÃÕâ¸ö±ðÃûϵÄÓû§À´¹ÜÀíÍøÂ磬ËùÒÔÈ¡ÁËNETADµÄ±ðÃû£»
User_Alias WEBMASTER=linuxsir ×¢£º¶¨ÒåÓû§±ðÃûWEBMASTER£¬ÎÒÏëÓÃÕâ¸ö±ðÃûϵÄÓû§À´¹ÜÀíÍøÕ¾£»
User_Alias SYSAD=beinan,linuxsir,bnnnb,lanhaitun:NETAD=beinan,bnnb:WEBMASTER=linuxsir ×¢£ºÉÏÃæÈýÐеıðÃû¶¨Ò壬¿ÉÒÔͨ¹ýÕâÒ»ÐÐÀ´ÊµÏÖ£¬Çë¿´Ç°ÃæµÄ˵Ã÷£¬ÊDz»ÊÇ·ûºÏ£¿
Cmnd_Alias USERMAG=/usr/sbin/adduser,/usr/sbin/userdel,/usr/bin/passwd [A-Za-z]*,/bin/chown,/bin/chmod
×¢Ò⣺ÃüÁî±ðÃûϵijÉÔ±±ØÐëÊÇÎļþ»òĿ¼µÄ¾ø¶Ô·¾¶£»
Cmnd_Alias DISKMAG=/sbin/fdisk,/sbin/parted
Cmnd_Alias NETMAG=/sbin/ifconfig,/etc/init.d/network
Cmnd_Alias KILL = /usr/bin/kill
Cmnd_Alias PWMAG = /usr/sbin/reboot,/usr/sbin/halt
Cmnd_Alias SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
/usr/local/bin/tcsh, /usr/bin/rsh, \
/usr/local/bin/zsh
×¢£ºÕâÐж¨ÒåÃüÁî±ðÃûÓе㳤£¬¿ÉÒÔͨ¹ý \ ºÅ¶ÏÐУ»
Cmnd_Alias SU = /usr/bin/su,/bin,/sbin,/usr/sbin,/usr/bin
ÔÚÉÏÃæµÄÀý×ÓÖУ¬ÓÐKILLºÍPWMAGµÄÃüÁî±ðÃû¶¨Ò壬ÎÒÃÇ¿ÉÒԺϲ¢ÎªÒ»ÐÐÀ´Ð´£¬Ò²¾ÍÊǵȼÛÐУ»
Cmnd_Alias KILL = /usr/bin/kill:PWMAG = /usr/sbin/reboot,/usr/sbin/halt ×¢£ºÕâÒ»Ðоʹú±íÁËKILLºÍPWMAGÃüÁî±ðÃû£¬°ÑKILLºÍPWMAGµÄ±ðÃû¶¨ÒåºÏ²¢ÔÚÒ»ÐÐдҲÊÇ¿ÉÒԵģ»
Runas_Alias OP = root, operator
Runas_Alias DBADM=mysql:OP = root, operator ×¢£ºÕâÐÐÊÇÉÏÃæÁ½ÐеĵȼÛÐУ»ÖÁÓÚÔõôÀí½âRunas_Alias £¬ÎÒÃDZØÐëµÃͨ¹ýÊÚȨ¹æÔòµÄʵÀýÀ´Àí½â£»
4¡¢/etc/sudoersÖеÄÊÚȨ¹æÔò£º
ÊÚȨ¹æÔòÊÇ·ÖÅäȨÏÞµÄÖ´ÐйæÔò£¬ÎÒÃÇÇ°ÃæËù½²µ½µÄ¶¨Òå±ðÃûÖ÷ÒªÊÇΪÁ˸ü·½±ãµÄÊÚȨÒýÓñðÃû£»Èç¹ûϵͳÖÐÖ»Óм¸¸öÓû§£¬ÆäʵÏ·ÅȨÏޱȽÏÓÐÏ޵Ļ°£¬¿ÉÒÔ²»Óö¨Òå±ðÃû£¬¶øÊÇÕë¶ÔϵͳÓû§Ö±½ÓÖ±½ÓÊÚȨ£¬ËùÒÔÔÚÊÚȨ¹æÔòÖбðÃû²¢²»ÊDZØÐëµÄ£»
ÊÚȨ¹æÔò²¢²»ÊÇÎÞÕ¿ÉÑ°£¬ÎÒÃÇֻ˵»ù´¡Ò»µãµÄ£¬±È½Ï¼òµ¥µÄд·¨£¬Èç¹ûÄúÏëÏêϸÁ˽âÊÚȨ¹æÔòд·¨µÄ£¬Çë²Î¿´man sudoers
ÊÚȨÓû§ Ö÷»ú=ÃüÁ×÷
ÕâÈý¸öÒªËØȱһ²»¿É£¬µ«ÔÚ¶¯×÷֮ǰҲ¿ÉÒÔÖ¸¶¨Çл»µ½Ìض¨Óû§Ï£¬ÔÚÕâÀïÖ¸¶¨Çл»µÄÓû§ÒªÓÃ( )ºÅÀ¨ÆðÀ´£¬Èç¹û²»ÐèÒªÃÜÂëÖ±½ÓÔËÐÐÃüÁîµÄ£¬Ó¦¸Ã¼ÓNOPASSWD:²ÎÊý£¬µ«ÕâЩ¿ÉÒÔÊ¡ÂÔ£»¾ÙÀý˵Ã÷£»
ʵÀýÒ»£º
beinan ALL=/bin/chown,/bin/chmod
Èç¹ûÎÒÃÇÔÚ/etc/sudoers ÖÐÌí¼ÓÕâÒ»ÐУ¬±íʾbeinan ¿ÉÒÔÔÚÈκοÉÄܳöÏÖµÄÖ÷»úÃûµÄϵͳÖУ¬¿ÉÒÔÇл»µ½rootÓû§ÏÂÖ´ÐÐ /bin/chown ºÍ/bin/chmod ÃüÁͨ¹ýsudo -l À´²é¿´beinan ÔÚÕą̂Ö÷»úÉÏÔÊÐíºÍ½ûÖ¹ÔËÐеÄÃüÁ
ÖµµÃ×¢ÒâµÄÊÇ£¬ÔÚÕâÀïÊ¡ÂÔÁËÖ¸¶¨Çл»µ½ÄĸöÓû§ÏÂÖ´ÐÐ/bin/shown ºÍ/bin/chmodÃüÁÔÚÊ¡ÂÔµÄÇé¿öÏÂĬÈÏΪÊÇÇл»µ½rootÓû§ÏÂÖ´ÐУ»Í¬Ê±Ò²Ê¡ÂÔÁËÊDz»ÊÇÐèÒªbeinanÓû§ÊäÈëÑéÖ¤ÃÜÂ룬Èç¹ûÊ¡ÂÔÁË£¬Ä¬ÈÏΪÊÇÐèÒªÑéÖ¤ÃÜÂë¡£
ΪÁ˸üÏêϸµÄ˵Ã÷ÕâЩ£¬ÎÒÃÇ¿ÉÒÔ¹¹ÔìÒ»¸ö¸ü¸´ÔÓÒ»µãµÄ¹«Ê½£»
ÊÚȨÓû§ Ö÷»ú=[(Çл»µ½ÄÄЩÓû§»òÓû§×é)] [ÊÇ·ñÐèÒªÃÜÂëÑéÖ¤] ÃüÁî1,[(Çл»µ½ÄÄЩÓû§»òÓû§×é)] [ÊÇ·ñÐèÒªÃÜÂëÑéÖ¤] [ÃüÁî2],[(Çл»µ½ÄÄЩÓû§»òÓû§×é)] [ÊÇ·ñÐèÒªÃÜÂëÑéÖ¤] [ÃüÁî3]......
×¢½â£º
·²ÊÇ[ ]ÖеÄÄÚÈÝ£¬ÊÇ¿ÉÒÔÊ¡ÂÔ£»ÃüÁîÓëÃüÁîÖ®¼äÓÃ,ºÅ·Ö¸ô£»Í¨¹ý±¾ÎĵÄÀý×Ó£¬¿ÉÒÔ¶ÔÕÕ×Å¿´ÄÄЩÊÇÊ¡ÂÔÁË£¬ÄÄЩµØ·½ÐèÒªÓпոñ£»
ÔÚ[(Çл»µ½ÄÄЩÓû§»òÓû§×é)] £¬Èç¹ûÊ¡ÂÔ£¬ÔòĬÈÏΪrootÓû§£»Èç¹ûÊÇALL £¬Ôò´ú±íÄÜÇл»µ½ËùÓÐÓû§£»×¢ÒâÒªÇл»µ½µÄÄ¿µÄÓû§±ØÐëÓÃ()ºÅÀ¨ÆðÀ´£¬±ÈÈç(ALL)¡¢(beinan)
ʵÀý¶þ£º
beinan ALL=(root) /bin/chown, /bin/chmod
Èç¹ûÎÒÃǰѵÚÒ»¸öʵÀýÖеÄÄÇÐÐÈ¥µô£¬»»³ÉÕâÐУ»±íʾµÄÊÇbeinan ¿ÉÒÔÔÚÈκοÉÄܳöÏÖµÄÖ÷»úÃûµÄÖ÷»úÖУ¬¿ÉÒÔÇл»µ½rootÏÂÖ´ÐÐ /bin/chown £¬¿ÉÒÔÇл»µ½ÈκÎÓû§ÕÐÖ´ÐÐ/bin/chmod ÃüÁͨ¹ýsudo -l À´²é¿´beinan ÔÚÕą̂Ö÷»úÉÏÔÊÐíºÍ½ûÖ¹ÔËÐеÄÃüÁ
ʵÀýÈý£º
beinan ALL=(root) NOPASSWD: /bin/chown,/bin/chmod
Èç¹û»»³ÉÕâ¸öÀý×ÓÄØ£¿±íʾµÄÊÇbeinan ¿ÉÒÔÔÚÈκοÉÄܳöÏÖµÄÖ÷»úÃûµÄÖ÷»úÖУ¬¿ÉÒÔÇл»µ½rootÏÂÖ´ÐÐ /bin/chown £¬²»ÐèÒªÊäÈëbeinanÓû§µÄÃÜÂ룻²¢ÇÒ¿ÉÒÔÇл»µ½ÈκÎÓû§ÏÂÖ´ÐÐ/bin/chmod ÃüÁµ«Ö´ÐÐchmodʱÐèÒªbeinanÊäÈë×Ô¼ºµÄÃÜÂ룻ͨ¹ýsudo -l À´²é¿´beinan ÔÚÕą̂Ö÷»úÉÏÔÊÐíºÍ½ûÖ¹ÔËÐеÄÃüÁ
¹ØÓÚÒ»¸öÃüÁ×÷ÊDz»ÊÇÐèÒªÃÜÂ룬ÎÒÃÇ¿ÉÒÔ·¢ÏÖÔÚϵͳÔÚĬÈϵÄÇé¿öÏÂÊÇÐèÒªÓû§ÃÜÂëµÄ£¬³ý·ÇÌؼÓÖ¸³ö²»ÐèÒªÓû§ÐèÒªÊäÈë×Ô¼ºÃÜÂ룬ËùÒÔÒªÔÚÖ´Ðж¯×÷֮ǰ¼ÓÈëNOPASSWD: ²ÎÊý£»
ÓпÉÄÜÓеĵÜÐÖ¶Ôϵͳ¹ÜÀíµÄÃüÁ̫¶®£¬²»ÖªµÀÆäÓ÷¨£¬ÕâÑù¾ÍÓ°ÏìÁËËû¶Ô sudoers¶¨ÒåµÄÀí½â£¬ÏÂÃæÎÒÃÇÔÙ¾ÙÒ»¸ö×î¼òµ¥£¬×îÓÐ˵·þÎñÁ¦µÄÀý×Ó£»
ʵÀýËÄ£º
±ÈÈçÎÒÃÇÏëÓÃbeinanÆÕͨÓû§Í¨¹ýmore /etc/shadowÎļþµÄÄÚÈÝʱ£¬¿ÉÄÜ»á³öÏÖÏÂÃæµÄÇé¿ö£»
[beinan@localhost ~]$ more /etc/shadow
/etc/shadow: ȨÏÞ²»¹»
ÕâʱÎÒÃÇ¿ÉÒÔÓÃsudo more /etc/shadow À´¶ÁÈ¡ÎļþµÄÄÚÈÝ£»¾Í¾ÍÐèÒªÔÚ/etc/soduersÖиøbeinanÊÚȨ£»
ÓÚÊÇÎÒÃǾͿÉÒÔÏÈsu µ½rootÓû§ÏÂͨ¹ývisudo À´¸Ä/etc/sudoers £»£¨±ÈÈçÎÒÃÇÊÇÒÔbeinanÓû§µÇ¼ϵͳµÄ£©
[beinan@localhost ~]$ su
Password: ×¢£ºÔÚÕâÀïÊäÈërootÃÜÂë
ÏÂÃæÔËÐÐvisodu£»
[root@localhost beinan]# visudo ×¢£ºÔËÐÐvisudo À´¸Ä /etc/sudoers
¼ÓÈëÈçÏÂÒ»ÐУ¬Í˳ö±£´æ£»Í˳ö±£´æ£¬ÔÚÕâÀïÒª»áÓÃvi£¬visudoÒ²ÊÇÓõÄvi±à¼Æ÷£»ÖÁÓÚviµÄÓ÷¨²»¶à˵ÁË£»
beinan ALL=/bin/more ±íʾbeinan¿ÉÒÔÇл»µ½rootÏÂÖ´ÐÐmore À´²é¿´Îļþ£»
Í˻ص½beinanÓû§Ï£¬ÓÃexitÃüÁ
[root@localhost beinan]# exit
exit
[beinan@localhost ~]$
²é¿´beinanµÄͨ¹ýsudoÄÜÖ´ÐÐÄÄЩÃüÁ
[beinan@localhost ~]$ sudo -l
Password: ×¢£ºÔÚÕâÀïÊäÈëbeinanÓû§µÄÃÜÂë
User beinan may run the following commands on this host: ×¢£ºÔÚÕâÀïÇåÎúµÄ˵Ã÷ÔÚ±¾Ì¨Ö÷»úÉÏ£¬beinanÓû§¿ÉÒÔÒÔrootȨÏÞÔËÐÐmore £»ÔÚrootȨÏÞϵÄmore £¬¿ÉÒԲ鿴ÈκÎÎı¾ÎļþµÄÄÚÈݵģ»
(root) /bin/more
×îºó£¬ÎÒÃÇ¿´¿´ÊDz»ÊÇbeinanÓû§ÓÐÄÜÁ¦¿´µ½/etc/shadowÎļþµÄÄÚÈÝ£»
[beinan@localhost ~]$ sudo more /etc/shadow
beinan ²»µ«ÄÜ¿´µ½ /etc/shadowÎļþµÄÄÚÈÝ£¬»¹ÄÜ¿´µ½Ö»ÓÐrootȨÏÞϲÅÄÜ¿´µ½µÄÆäËüÎļþµÄÄÚÈÝ£¬±ÈÈ磻
[beinan@localhost ~]$ sudo more /etc/gshadow
¶ÔÓÚbeinanÓû§²é¿´ºÍ¶ÁÈ¡ËùÓÐϵͳÎļþÖУ¬ÎÒÖ»Ïë°Ñ/etc/shadow µÄÄÚÈÝ¿ÉÒÔÈÃËû²é¿´£»¿ÉÒÔ¼ÓÈëÏÂÃæµÄÒ»ÐУ»
beinan ALL=/bin/more /etc/shadow
ÌâÍâ»°£ºÓеĵÜÐÖ»á˵£¬ÎÒͨ¹ýsu Çл»µ½rootÓû§¾ÍÄÜ¿´µ½ËùÓÐÏë¿´µÄÄÚÈÝÁË£¬¹þ¹þ£¬¶Ô°¡¡£µ«ÔÛÃÇÏÖÔÚ²»ÊÇÔÚ½²ÊösudoµÄÓ÷¨Âð£¿Èç¹ûÖ÷»úÉÏÓжà¸öÓû§²¢ÇÒ²»ÖªµÀrootÓû§µÄÃÜÂ룬µ«ÓÖÏë²é¿´Ä³Ð©ËûÃÇ¿´²»µ½µÄÎļþ£¬Õâʱ¾ÍÐèÒª¹ÜÀíÔ±ÊÚȨÁË£»Õâ¾ÍÊÇsudoµÄºÃ´¦£»
ʵÀýÎ壺Á·Ï°Óû§×éÔÚ/etc/sudoersÖÐд·¨£»
Èç¹ûÓû§×é³öÏÖÔÚ/etc/sudoers ÖУ¬Ç°ÃæÒª¼Ó%ºÅ£¬±ÈÈç%beinan £¬Öм䲻ÄÜÓпոñ£»
%beinan ALL=/usr/sbin/*,/sbin/*
Èç¹ûÎÒÃÇÔÚ /etc/sudoers ÖмÓÉÏÈçÉÏÒ»ÐУ¬±íʾbeinanÓû§×éϵÄËùÓгÉÔ±£¬ÔÚËùÓпÉÄܵijöÏÖµÄÖ÷»úÃûÏ£¬¶¼ÄÜÇл»µ½rootÓû§ÏÂÔËÐÐ /usr/sbinºÍ/sbinĿ¼ÏµÄËùÓÐÃüÁ
ʵÀýÁù£ºÁ·Ï°È¡ÏûijÀà³ÌÐòµÄÖ´ÐУ»
È¡Ïû³ÌÐòijÀà³ÌÐòµÄÖ´ÐУ¬ÒªÔÚÃüÁ×÷Ç°Ãæ¼ÓÉÏ!ºÅ£» ÔÚ±¾ÀýÖÐÒ²³öÏÖÁËͨÅä·ûµÄ*µÄÓ÷¨£»
beinan ALL=/usr/sbin/*,/sbin/*,!/usr/sbin/fdisk ×¢£º°ÑÕâÐйæÔò¼ÓÈëµ½/etc/sudoersÖУ»µ«ÄúµÃÓÐbeinanÕâ¸öÓû§×飬²¢ÇÒbeinanÒ²ÊÇÕâ¸ö×éÖеIJÅÐУ»
±¾¹æÔò±íʾbeinanÓû§ÔÚËùÓпÉÄÜ´æÔÚµÄÖ÷»úÃûµÄÖ÷»úÉÏÔËÐÐ/usr/sbinºÍ/sbinÏÂËùÓеijÌÐò£¬µ«fdisk ³ÌÐò³ýÍ⣻
[beinan@localhost ~]$ sudo -l
Password: ×¢£ºÔÚÕâÀïÊäÈëbeinanÓû§µÄÃÜÂ룻
User beinan may run the following commands on this host:
(root) /usr/sbin/*
(root) /sbin/*
(root) !/sbin/fdisk
[beinan@localhost ~]$ sudo /sbin/fdisk -l
Sorry, user beinan is not allowed to execute '/sbin/fdisk -l' as root on localhost.
×¢£º²»ÄÜÇл»µ½rootÓû§ÏÂÔËÐÐfdisk ³ÌÐò£»
ʵÀýÆߣº±ðÃûµÄÔËÓõÄʵ¼ù£»
¼ÙÈçÎÒÃǾÍһ̨Ö÷»úlocalhost£¬ÄÜͨ¹ýhostname À´²é¿´£¬ÎÒÃÇÔÚÕâÀï¾Í²»¶¨ÒåÖ÷»ú±ðÃûÁË£¬ÓÃALLÀ´Æ¥ÅäËùÓпÉÄܳöÏÖµÄÖ÷»úÃû£»²¢ÇÒÓÐbeinan¡¢linuxsir¡¢lanhaitun Óû§£»Ö÷ÒªÊÇͨ¹ýСÀý×ÓÄܸüºÃÀí½â£»sudoËäÈ»¼òµ¥ºÃÓ㬵«ÄÜ°Ñ˵µÄÃ÷°×µÄÈ·ÊǼþÄÑÊ£»×îºÃµÄ°ì·¨ÊǶ࿴Àý×ÓºÍman soduers £»
User_Alias SYSADER=beinan,linuxsir,%beinan
User_Alias DISKADER=lanhaitun
Runas_Alias OP=root
Cmnd_Alias SYDCMD=/bin/chown,/bin/chmod,/usr/sbin/adduser,/usr/bin/passwd [A-Za-z]*,!/usr/bin/passwd root
Cmnd_Alias DSKCMD=/sbin/parted,/sbin/fdisk ×¢£º¶¨ÒåÃüÁî±ðÃûDSKCMD£¬ÏÂÓгÉÔ±partedºÍfdisk £»
SYSADER ALL= SYDCMD,DSKCMD
DISKADER ALL=(OP) DSKCMD
×¢½â£º
µÚÒ»ÐУº¶¨ÒåÓû§±ðÃûSYSADER ÏÂÓгÉÔ± beinan¡¢linuxsirºÍbeinanÓû§×éϵijÉÔ±£¬Óû§×éÇ°Ãæ±ØÐë¼Ó%ºÅ£»
µÚ¶þÐУº¶¨ÒåÓû§±ðÃû DISKADER £¬³ÉÔ±ÓÐlanhaitun
µÚÈýÐУº¶¨ÒåRunasÓû§£¬Ò²¾ÍÊÇÄ¿±êÓû§µÄ±ðÃûΪOP£¬ÏÂÓгÉÔ±root
µÚËÄÐУº¶¨ÒåSYSCMDÃüÁî±ðÃû£¬³ÉÔ±Ö®¼äÓÃ,ºÅ·Ö¸ô£¬×îºóµÄ!/usr/bin/passwd root ±íʾ²»ÄÜͨ¹ýpasswd À´¸ü¸ÄrootÃÜÂ룻
µÚÎåÐУº¶¨ÒåÃüÁî±ðÃûDSKCMD£¬ÏÂÓгÉÔ±partedºÍfdisk £»
µÚÁùÐУº ±íʾÊÚȨSYSADERϵÄËùÓгÉÔ±£¬ÔÚËùÓпÉÄÜ´æÔÚµÄÖ÷»úÃûµÄÖ÷»úÏÂÔËÐлò½ûÖ¹ SYDCMDºÍDSKCMD϶¨ÒåµÄÃüÁî¡£¸üΪÃ÷ȷң˵£¬beinan¡¢linuxsirºÍbeinanÓû§×éϵijÉÔ±ÄÜÒÔrootÉí·ÝÔËÐÐ chown ¡¢chmod ¡¢adduser¡¢passwd£¬µ«²»Äܸü¸ÄrootµÄÃÜÂ룻Ҳ¿ÉÒÔÒÔrootÉí·ÝÔËÐÐ partedºÍfdisk £¬±¾Ìõ¹æÔòµÄµÈ¼Û¹æÔòÊÇ£»
beinan,linuxsir,%beinan ALL=/bin/chown,/bin/chmod,/usr/sbin/adduser,/usr/bin/passwd [A-Za-z]*,!/usr/bin/passwd root,/sbin/parted,/sbin/fdisk
µÚÆßÐУº±íʾÊÚȨDISKADER ϵÄËùÓгÉÔ±£¬ÄÜÒÔOPµÄÉí·Ý£¬À´ÔËÐÐ DSKCMD £¬²»ÐèÒªÃÜÂ룻¸üΪÃ÷È·µÄ˵ lanhaitun ÄÜÒÔrootÉí·ÝÔËÐÐ partedºÍfdisk ÃüÁÆäµÈ¼Û¹æÔòÊÇ£º
lanhaitun ALL=(root) /sbin/parted,/sbin/fdisk
¿ÉÄÜÓеĵÜÐÖ»á˵ÎÒÏë²»ÊäÈëÓû§µÄÃÜÂë¾ÍÄÜÇл»µ½root²¢ÔËÐÐSYDCMDºÍDSKCMD ϵÄÃüÁÄÇÓ¦¸Ã°Ñ°ÑNOPASSWD:¼ÓÔÚÄÄÀïΪºÃ£¿Àí½âÏÂÃæµÄÀý×Ó°É£¬ÄÜÃ÷°×µÄ£»
SYSADER ALL= NOPASSWD: SYDCMD, NOPASSWD: DSKCMD
5¡¢/etc/sudoersÖÐÆäËüµÄδ¾¡ÊÂÏ
ÔÚÊÚȨ¹æÔòÖУ¬»¹ÓÐ NOEXEC:ºÍEXECµÄÓ÷¨£¬×Ô¼º²éman sudoers Á˽⣻»¹ÓйØÓÚÔÚ¹æÔòÖÐͨÅä·ûµÄÓ÷¨£¬Ò²ÊÇÐèÒªÁ˽âµÄ¡£ÕâЩÄÚÈݲ»¶à˵ÁË£¬±Ï¾¹Ö»ÊÇÒ»¸öÈëÃÅÐÔµÄÎĵµ¡£soduersÅäÖÃÎļþÒª¶à¼òµ¥¾ÍÓжà¼òµ¥£¬Òª¶àÄѾÍÓжàÄÑ£¬¾Í¿´×Ô¼ºµÄÓ¦ÓÃÁË¡£
6¡¢sudoµÄÓ÷¨£»
ÎÒÃÇÔÚÇ°Ãæ½²µÄ/etc/sudoers µÄ¹æÔòд·¨£¬×îÖÕµÄÄ¿µÄÊÇÈÃÓû§Í¨¹ýsudo¶ÁÈ¡ÅäÖÃÎļþÖеĹæÔòÀ´ÊµÏÖÆ¥ÅäºÍÊÚȨ£¬ÒÔ±ãÌæ»»Éí·ÝÀ´½øÐÐÃüÁî²Ù×÷£¬½ø¶øÍê³ÉÔÚÆäȨÏÞϲ»¿ÉÍê³ÉµÄÈÎÎñ£»
ÎÒÃÇֻ˵×î¼òµ¥µÄÓ÷¨£»¸üΪÏêϸµÄÇë²Î¿¼man sudo
sudo [²ÎÊýÑ¡Ïî] ÃüÁî
-l ÁгöÓû§ÔÚÖ÷»úÉÏ¿ÉÓõĺͱ»½ûÖ¹µÄÃüÁһ°ãÅäÖúÃ/etc/sudoersºó£¬ÒªÓÃÕâ¸öÃüÁîÀ´²é¿´ºÍ²âÊÔÊDz»ÊÇÅäÖÃÕýÈ·µÄ£»
-v ÑéÖ¤Óû§µÄʱ¼ä´Á£»Èç¹ûÓû§ÔËÐÐsudo ºó£¬ÊäÈëÓû§µÄÃÜÂëºó£¬ÔÚ¶Ìʱ¼äÄÚ¿ÉÒÔ²»ÓÃÊäÈë¿ÚÁîÀ´Ö±½Ó½øÐÐsudo ²Ù×÷£»ÓÃ-v ¿ÉÒÔ¸ú×Ù×îеÄʱ¼ä´Á£»
-u Ö¸¶¨ÒÔÒÔij¸öÓû§Ö´ÐÐÌض¨²Ù×÷£»
-k ɾ³ýʱ¼ä´Á£¬ÏÂÒ»¸ösudo ÃüÁîÒªÇóÓÃÇóÌṩÃÜÂ룻
¾ÙÁУº
Ê×ÏÈÎÒÃÇͨ¹ývisudo À´¸Ä/etc/sudoers Îļþ£¬¼ÓÈëÏÂÃæÒ»ÐУ»
beinan,linuxsir,%beinan ALL=/bin/chown,/bin/chmod,/usr/sbin/adduser,/usr/bin/passwd [A-Za-z]*,!/usr/bin/passwd root,/sbin/parted,/sbin/fdisk
È»ºóÁгöbeinanÓû§ÔÚÖ÷»úÉÏͨ¹ýsudo ¿ÉÒÔÇл»Óû§ËùÄÜÓõÄÃüÁî»ò±»½ûÖ¹ÓõÄÃüÁ
[beinan@localhost ~]$ sudo -l ×¢£ºÁгöÓû§ÔÚÖ÷»úÉÏÄÜͨ¹ýÇл»Óû§µÄ¿ÉÓõĻò±»½ûÖ¹µÄÃüÁ
Password: ×¢£ºÔÚÕâÀïÊäÈëÄúµÄÓû§ÃÜÂ룻
User beinan may run the following commands on this host:
(root) /bin/chown ×¢£º¿ÉÒÔÇл»µ½rootÏÂÓÃchownÃüÁ
(root) /bin/chmod ×¢£º¿ÉÒÔÇл»µ½rootÏÂÓÃchmodÃüÁ
(root) /usr/sbin/adduser ×¢£º¿ÉÒÔÇл»µ½rootÏÂÓÃadduserÃüÁ
(root) /usr/bin/passwd [A-Za-z]* ×¢£º¿ÉÒÔÇл»µ½rootÏÂÓà passwd ÃüÁ
(root) !/usr/bin/passwd root ×¢£º¿ÉÒÔÇл»µ½rootÏ£¬µ«²»ÄÜÖ´ÐÐpasswd root À´¸ü¸ÄrootÃÜÂ룻
(root) /sbin/parted ×¢£º¿ÉÒÔÇл»µ½ rootÏÂÖ´ÐÐparted £»
(root) /sbin/fdisk ×¢£º¿ÉÒÔÇл»µ½rootÏÂÖ´ÐÐ fdisk £»
ͨ¹ýÉÏÃæµÄsudo -l Áгö¿ÉÓÃÃüÁîºó£¬ÎÒÏëͨ¹ýchown ÃüÁîÀ´¸Ä±ä/optĿ¼µÄÊôÖ÷Ϊbeinan £»
[beinan@localhost ~]$ ls -ld /opt ×¢£º²é¿´/optµÄÊôÖ÷£»
drwxr-xr-x 26 root root 4096 10Ô 27 10:09 /opt ×¢£ºµÃµ½µÄ´ð°¸ÊǹéÊôrootÓû§ºÍrootÓû§×飻
[beinan@localhost ~]$ sudo chown beinan:beinan /opt ×¢£ºÍ¨¹ýchown À´¸Ä±äÊôÖ÷ΪbeinanÓû§ºÍbeinanÓû§×飻
[beinan@localhost ~]$ ls -ld /opt ×¢£º²é¿´/optÊôÖ÷ÊDz»ÊÇÒѾ¸Ä±äÁË£»
drwxr-xr-x 26 beinan beinan 4096 10ÔÂ 27 10:09 /opt
ÎÒÃÇͨ¹ýÉÏÃæµÄÀý×Ó·¢ÏÖbeinanÓû§ÄÜÇл»µ½rootºóÖ´ÐиıäÓû§¿ÚÁîµÄpasswdÃüÁµ«ÉÏÃæµÄsudo -l Êä³öÓÖÃ÷ÎÄд×Ų»Äܸü¸ÄrootµÄ¿ÚÁҲ¾ÍÊÇ˵³ýÁËrootµÄ¿ÚÁbeinanÓû§²»Äܸü¸ÄÍ⣬ÆäËüÓû§µÄ¿ÚÁÄܸü¸Ä¡£ÏÂÃæÎÒÃÇÀ´²âÊÔ£»
¶ÔÓÚÒ»¸öÆÕͨÓû§À´Ëµ£¬³ýÁ˸ü¸Ä×ÔÉíµÄ¿ÚÁîÒÔÍ⣬Ëû²»Äܸü¸ÄÆäËüÓû§µÄ¿ÚÁî¡£µ«Èç¹û»»µ½rootÉí·ÝÖ´ÐÐÃüÁÔò¿ÉÒÔ¸ü¸ÄÆäËüÓû§µÄ¿ÚÁ
±ÈÈçÔÚϵͳÖÐÓÐlinuxsirÕâ¸öÓû§, ÎÒÃÇÏë³¢ÊÔ¸ü¸ÄÕâ¸öÓû§µÄ¿ÚÁ
[beinan@localhost ~]$ passwd linuxsir ×¢£º²»Í¨¹ýsudo Ö±½ÓÔËÐÐpasswd À´¸ü¸ÄlinuxsirÓû§µÄ¿ÚÁ
passwd: Only root can specify a user name. ×¢£ºÊ§°Ü£¬Ìáʾ½öÄÜͨ¹ý rootÀ´¸ü¸Ä£»
[beinan@localhost ~]$ sudo passwd linuxsir ×¢£ºÎÒÃÇͨ¹ý/etc/sudoers µÄ¶¨Ò壬ÈÃbeinanÇл»µ½rootÏÂÖ´ÐÐ passwd ÃüÁîÀ´¸Ä±älinuxsirµÄ¿ÚÁ
Changing password for user linuxsir.
New UNIX password: ×¢£ºÊäÈëпÚÁ
Retype new UNIX password: ×¢£ºÔÙÊäÈëÒ»´Î£»
passwd: all authentication tokens updated successfully. ×¢£º¸Ä±ä³É¹¦£»
ºó¼Ç£º
±¾ÎÄÊÇÓû§¹ÜÀíµÄÎĵµµÄÖØÒª×é³É²¿·Ý£¬ÎҼƻ®ÔÚÃ÷Ì쿪ʼдÓû§¹ÜÀí¿ØÖƹ¤¾ß£¬±ÈÈç useradd¡¢userdel¡¢usermod £¬Ò²¾ÍÊǹÜÀíÓû§µÄ¹¤¾ß½éÉÜ£»µ±È»ÎÒ»¹»áдÓû§²éѯ¹¤¾ßµÈÓëÓû§¹ÜÀíÏà¹ØµÄ£»
sclzwj ÓÚ 2010-01-07 08:51:22·¢±í:
ÕâôºÃµÄÌû£¬ÎÒ¶¥¡£
²ËÑÀ ÓÚ 2010-01-06 19:45:23·¢±í:
ºÃÌû ¶¥
xiadao_81 ÓÚ 2010-01-06 15:58:50·¢±í:
´ËÌù¾ÓȻûÈ˶¥£¡