LinuxЧÀÍÆ÷ÈÕ־ȨÏÞ¹ýʧ¼°ÐÞ¸´ÒªÁì
linuxЧÀÍÆ÷Éϳ£¼ûµÄÈÕÖ¾ÎļþȨÏÞÉèÖùýʧ¼°ÆäÐÞ¸´ÒªÁì
ÕªÒª£ºÈÕÖ¾ÎļþÊÇLinuxЧÀÍÆ÷ÖÐÖ÷ÒªµÄ×é³É²¿·Ö£¬¹ØÓÚЧÀÍÆ÷µÄÇå¾²ºÍÖÎÀíÖÁ¹ØÖ÷Òª¡£Òò´Ë£¬×¼È·µØÉèÖÃÈÕÖ¾ÎļþµÄȨÏÞºÜÊÇÖ÷Òª¡£±¾ÎĽ«ÏÈÈÝһЩ³£¼ûµÄÈÕÖ¾ÎļþȨÏÞÉèÖùýʧ£¬²¢ÌṩÏìÓ¦µÄÐÞ¸´ÒªÁì¡£
¸ÅÊö
ÔÚLinuxЧÀÍÆ÷ÉÏ£¬ÈÕÖ¾ÎļþÓÃÀ´¼Í¼ϵͳºÍÓ¦ÓóÌÐòµÄÔËÐÐÐÅÏ¢£¬°üÀ¨¹ýʧÈÕÖ¾¡¢ÏµÍ³ÈÕÖ¾¡¢»á¼ûÈÕÖ¾µÈ¡£Ä¿Â¼ÖÐĬÈÏ×°ÖÃÓÐÐí¶àÈÕÖ¾Îļþ£¬ÀýÈç/var/logĿ¼ÏµÄÎļþ¡£×¼È·µØÉèÖÃÈÕÖ¾ÎļþµÄȨÏÞ¿ÉÒÔÈ·±£Ö»ÓÐÓÐȨ»á¼ûµÄÓû§Äܹ»Éó²éºÍÐÞËûÈÕÖ¾Îļþ¡£
³£¼û¹ýʧ
2.1 ȨÏÞÉèÖùý´ó
ÓÐʱ¼ä£¬ÖÎÀíԱΪÁ˼ò»¯²Ù×÷»òÀû±ãÆäËûÓû§Éó²éÈÕÖ¾Îļþ£¬»áÉèÖùý´óµÄȨÏÞ¡£ºÃ±È£¬½«ÈÕÖ¾ÎļþµÄȨÏÞÉèÖÃΪ777£¬¼´ËùÓÐÓû§¶¼¾ßÓжÁ¡¢Ð´ºÍÖ´ÐÐȨÏÞ¡£ËäÈ»ÕâÑù×öÀû±ã£¬µ«Ò²¸øϵͳÇå¾²ÁôÏÂÁËÒþ»¼¡£¹¥»÷Õß¿ÉÄÜ»áʹÓÃÕâЩȨÏÞÌí¼Ó¶ñÒâ´úÂë»òɾ³ýÖ÷ÒªÈÕÖ¾Îļþ£¬´Ó¶øÆÆËðϵͳµÄÎȹÌÐÔºÍÇå¾²ÐÔ¡£
2.2 ȨÏÞÉèÖùýС
ÁíÒ»·½Ã棬ȨÏÞÉèÖùýСҲ»á´øÀ´ÎÊÌâ¡£ÈôÊǽ«ÈÕÖ¾ÎļþµÄȨÏÞÉèÖÃΪ400£¬¼´Ö»ÓÐËùÓÐÕß¾ßÓжÁȨÏÞ£¬ÆäËûÓû§Ã»ÓÐÈκÎȨÏÞ¡£ÕâÑù×ö»áµ¼ÖÂͨË×Óû§ÎÞ·¨Éó²éºÍÐÞËûÈÕÖ¾Îļþ£¬¸øÅÅÅÌÎÊÌâºÍÆÊÎöÈÕÖ¾´øÀ´ÄÑÌâ¡£
2.3 Óû§×éÉèÖùýʧ
ÔÚLinuxЧÀÍÆ÷ÖУ¬Óû§×éÊÇÖÎÀíÓû§È¨ÏÞµÄÖ÷Òª»úÖÆÖ®Ò»¡£È»¶ø£¬Ò»Ð©ÖÎÀíÔ±¿ÉÄÜ»á¹ýʧµØÉèÖÃÓû§×飬µ¼Ö²»ÐëÒªµÄ»á¼ûȨÏÞ¡£¾Ù¸öÀý×Ó£¬ÉèÖÃÁËÓû§×éΪ”root”µÄÈÕÖ¾Îļþ£¬ÕâÑùËùÓоßÓÐrootȨÏÞµÄÓû§¶¼¿ÉÒÔ»á¼ûºÍÐÞ¸ÄÕâЩÎļþ¡£ÕâÖÖÉèÖûáÆÆËðЧÀÍÆ÷µÄÇå¾²ÐÔ£¬ÓÉÓÚ·ÇrootÓû§Ò²¿ÉÒÔ»á¼ûÃô¸ÐÐÅÏ¢¡£
ÐÞ¸´ÒªÁì
ΪÁËÐÞ¸´ÉÏÊö¹ýʧ£¬ÎÒÃÇÌṩÒÔϼ¸ÖÖÐÞ¸´ÒªÁ죺
3.1 Êʵ±ÉèÖÃȨÏÞ
¹ØÓÚÈÕÖ¾Îļþ£¬ÊÊÍâµØÉèÖÃȨÏÞºÜÊÇÖ÷Òª¡£Ò»Ñùƽ³£À´Ëµ£¬644ÊÇÒ»¸ö½ÏΪºÏÊʵÄȨÏÞÉèÖ㬼´ËùÓÐÕß¾ßÓжÁдȨÏÞ£¬ÆäËûÓû§Ö»ÓжÁȨÏÞ¡£ÕâÑùÉèÖüȿÉÒÔ±£»¤ÈÕÖ¾ÎļþµÄÍêÕûÐÔ£¬ÓÖÔÊÐíͨË×Óû§Éó²éÈÕÖ¾Îļþ¡£
3.2 ʹÓÃchownºÍchgrpÏÂÁîÐÞ¸ÄËùÓÐÕߺÍÓû§×é
ͨ¹ýʹÓÃchownºÍchgrpÏÂÁ¿ÉÒÔÐÞËûÈÕÖ¾ÎļþµÄËùÓÐÕߺÍÓû§×é¡£ÀýÈ磬ʹÓÃÒÔÏÂÏÂÁÈÕÖ¾ÎļþµÄËùÓÐÕߺÍÓû§×éÉèÖÃΪ”root”£º
sudo chown root:root /var/log/example.log
3.3 ʹÓÃchmodÏÂÁîÐÞ¸ÄȨÏÞ
½èÖúchmodÏÂÁ¿ÉÒÔÐÞËûÈÕÖ¾ÎļþµÄȨÏÞ¡£ÀýÈ磬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÈÕÖ¾ÎļþµÄȨÏÞÉèÖÃΪ644£º
sudo chmod 644 /var/log/example.log
½áÂÛ
׼ȷµØÉèÖÃLinuxЧÀÍÆ÷ÉϵÄÈÕÖ¾ÎļþȨÏÞÊÇ°ü¹ÜЧÀÍÆ÷Çå¾²ºÍÖÎÀíµÄÖ÷Òª»·½Ú¡£±¾ÎÄÏÈÈÝÁ˳£¼ûµÄÈÕÖ¾ÎļþȨÏÞÉèÖùýʧ£¬°üÀ¨È¨ÏÞÉèÖùý´ó¡¢È¨ÏÞÉèÖùýСºÍÓû§×éÉèÖùýʧ£¬²¢ÌṩÁËÏìÓ¦µÄÐÞ¸´ÒªÁì¡£ÖÎÀíÔ±Ó¦¸ÃÇмDz¢×ñÊØÕâЩÐÞ¸´ÒªÁìÀ´È·±£Ð§ÀÍÆ÷µÄÎȹÌÐÔºÍÇå¾²ÐÔ¡£
ÒÔÉϾÍÊÇLinuxЧÀÍÆ÷ÈÕ־ȨÏÞ¹ýʧ¼°ÐÞ¸´ÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡