linuxÖеÄrwsÊÇʲôÒâ˼
linuxÖеġ°rws¡±ÊÇÒ»ÖÖÎļþȨÏÞģʽ£¬ÓÃÓÚÉèÖÃÎļþµÄȨÏÞ£¬rwsȨÏÞģʽ°üÀ¨µÄȨÏÞÓУº1¡¢r£¬ÔÊÐí¶ÁÈ¡ÎļþÄÚÈÝ£»2¡¢w£¬ÔÊÐíÐ޸Ļòɾ³ýÎļþÄÚÈÝ£»3¡¢s£¬½«ÎļþµÄÐÞ¸Äͬ²½µ½´æ´¢½éÖÊÉÏ¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚLinuxÖУ¬rws ÊÇÒ»ÖÖÎļþȨÏÞģʽ£¬ÓÃÓÚÉèÖÃÎļþµÄȨÏÞ¡£ËüÊÇ read-write-sync µÄËõд£¬ÌåÏÖͬʱÉèÖöÁÈ¡¡¢Ð´ÈëºÍͬ²½È¨ÏÞ¡£
ÏêϸÀ´Ëµ£¬rws ȨÏÞģʽ°üÀ¨ÒÔϼ¸¸öȨÏÞ£º
r£¨read£©£ºÔÊÐí¶ÁÈ¡ÎļþÄÚÈÝ¡£
w£¨write£©£ºÔÊÐíÐ޸Ļòɾ³ýÎļþÄÚÈÝ¡£
s£¨sync£©£º½«ÎļþµÄÐÞ¸Äͬ²½µ½´æ´¢½éÖÊÉÏ¡£
ÔÚͨÀýµÄÎļþȨÏÞģʽÖУ¬ s ͨ³£Ö¸µÄÊÇÉèÖà “setuid” »ò “setgid” ÊôÐÔ¡£µ± s ÉèÖÃÔÚËùÓÐÕßµÄȨÏÞλÉÏʱ£¬±»Ö´ÐеÄÎļþ»á¼ÌÐøËùÓÐÕßµÄȨÏÞ£¬¶ø²»ÊÇÖ´ÐÐÕßµÄȨÏÞ¡£µ± s ÉèÖÃÔÚ×éȨÏÞλÉÏʱ£¬±»Ö´ÐеÄÎļþ»á¼ÌÐø×éµÄȨÏÞ¡£È»¶ø£¬ÔÚÄ¿½ñµÄÉÏÏÂÎÄÖУ¬rws ¿ÉÄÜÖ¸µÄÊÇÉèÖÃÎļþµÄͬ²½È¨ÏÞ¶ø²»Éæ¼°ÌØÊâȨÏÞ¡£
ҪʹÓà rws ȨÏÞģʽÀ´ÉèÖÃÎļþµÄȨÏÞ£¬¿ÉÒÔʹÓà chmod ÏÂÁÀýÈ磺
chmod 4000 file.txt
µÇ¼ºó¸´ÖÆ
Õ⽫½« file.txt ÎļþµÄȨÏÞÉèÖÃΪ rws——£¬¼´Ö»ÓÐËùÓÐÕßÓµÓжÁÈ¡¡¢Ð´ÈëºÍͬ²½È¨ÏÞ¡£
ÐèҪעÖصÄÊÇ£¬¹ØÓÚÒ»Ñùƽ³£µÄÎļþ£¬Í¨³£²»ÍƼöÖ±½ÓʹÓà rws ȨÏÞģʽ¡£ÈôÊÇÄúÏëÒªÉèÖÃÎļþµÄÌض¨È¨ÏÞ£¬Çëƾ֤ÏêϸÐèÇóÑ¡ÔñºÏÊʵÄȨÏÞģʽ¾ÙÐÐÉèÖá£
ÒÔÉϾÍÊÇlinuxÖеÄrwsÊÇʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡