linuxȨÏÞÏÂÁîÔõôÉèÖÃ
ÒªÉèÖà linux ÎļþºÍĿ¼ȨÏÞ£¬¿ÉÒÔʹÓà chmod ÏÂÁî¡£chmod ÏÂÁîµÄÓ﷨Ϊ£ºchmod [Ñ¡Ïî] ģʽ Îļþ/Ŀ¼£¬ÆäÖÐÑ¡ÏîÓÐ -r£¨µÝ¹éÉèÖÃȨÏÞ£©¡¢-v£¨ÏÔʾÉèÖÃȨÏ޵IJÙ×÷Ч¹û£©£¬¶øģʽÓÉÈýλÊý×Ö×é³É£¬»®·ÖÌåÏÖÓû§¡¢×éºÍÆäËûÓû§µÄȨÏÞ¡£ÈçÐèÉèÖÃÎļþËùÓÐÕߵĶÁ¡¢Ð´¡¢Ö´ÐÐȨÏÞ£¬¿ÉÊäÈë chmod 700 myfile£»ÈçÐèÉèÖÃÒ»¸ö×éµÄËùÓÐÕߵĶÁ¡¢Ð´È¨ÏÞ£¬ÆäËûÓû§µÄ¶ÁȨÏÞ£¬¿ÉÊäÈë chmod 644 myfile¡£
LinuxȨÏÞÏÂÁîÉèÖÃ
ÔõÑùÉèÖÃLinuxÎļþºÍĿ¼ȨÏÞ£¿
ÔÚLinuxÖУ¬Ê¹ÓÃchmodÏÂÁîÉèÖÃÎļþºÍĿ¼µÄȨÏÞ¡£ÆäÓï·¨ÈçÏ£º
chmod [Ñ¡Ïî] ģʽ Îļþ/Ŀ¼
µÇ¼ºó¸´ÖÆ
Ñ¡Ï
-R£ºµÝ¹éÉèÖÃȨÏÞ
-v£ºÏÔʾÉèÖÃȨÏ޵IJÙ×÷Ч¹û
ģʽ£º
ģʽÓÉÈýλÊý×Ö×é³É£¬»®·ÖÌåÏÖÓû§¡¢×éºÍÆäËûÓû§µÄȨÏÞ£º
Óû§È¨ÏÞ£º
r£º¶ÁȨÏÞ
w£ºÐ´È¨ÏÞ
x£ºÖ´ÐÐȨÏÞ
×éȨÏÞ£º
r£º¶ÁȨÏÞ
w£ºÐ´È¨ÏÞ
x£ºÖ´ÐÐȨÏÞ
ÆäËûÓû§È¨ÏÞ£º
r£º¶ÁȨÏÞ
w£ºÐ´È¨ÏÞ
x£ºÖ´ÐÐȨÏÞ
ÏÂÁîʹÓÃʾÀý£º
ÉèÖÃÎļþËùÓÐÕߵĶÁ¡¢Ð´¡¢Ö´ÐÐȨÏÞ£¨È¨ÏÞΪ700£©£º
chmod 700 myfile
µÇ¼ºó¸´ÖÆ
ÉèÖÃÒ»¸ö×éµÄËùÓÐÕߵĶÁ¡¢Ð´È¨ÏÞ£¬ÆäËûÓû§µÄ¶ÁȨÏÞ£¨È¨ÏÞΪ644£©£º
chmod 644 myfile
µÇ¼ºó¸´ÖÆ
µÝ¹éÉèÖÃĿ¼¼°ÆäËùÓÐÎļþºÍ×ÓĿ¼µÄËùÓÐÕߵĶÁ¡¢Ð´¡¢Ö´ÐÐȨÏÞ£¬×éÓû§µÄ¶Á¡¢Ö´ÐÐȨÏÞ£¬ÆäËûÓû§µÄ¶ÁȨÏÞ£¨È¨ÏÞΪ755£©£º
chmod -R 755 mydirectory
µÇ¼ºó¸´ÖÆ
ÏÔʾÉèÖÃȨÏ޵IJÙ×÷Ч¹û£º
chmod -v 755 myfile
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
Ö»ÓоßÓÐ×㹻ȨÏÞµÄÓû§²Å»ªÉèÖÃÎļþ»òĿ¼µÄȨÏÞ¡£
ȨÏÞÒ԰˽øÖÆÐÎʽÌåÏÖ£¬Èç755¡£
ȨÏÞλÖÐûÓÐÁгöµÄȨÏÞ½«±»×÷·Ï¡£
Êý×ÖȨÏÞÊÇÒ»ÖÖ¿ì½Ý·½·¨£¬µ«Ò²¿ÉÒÔʹÓ÷ûºÅȨÏÞ£¨ÀýÈçu+rwx£©¡£
ÒÔÉϾÍÊÇlinuxȨÏÞÏÂÁîÔõôÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡