尊龙凯时人生就是搏

ÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄȨÏÞÖÎÀí

ÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄȨÏÞÖÎÀí

ÔÚLinux²Ù×÷ϵͳÖÐ  £¬È¨ÏÞÖÎÀíÊǺÜÊÇÖ÷ÒªÇұز»¿ÉÉÙµÄÒ»ÏîʹÃü¡£¾ßÓи߿ÉÓÃÐÔµÄȨÏÞÖÎÀí¿ÉÒÔ±ÜÃâδ¾­ÊÚȨµÄÓû§»á¼ûÃô¸ÐÊý¾Ý  £¬±£»¤ÏµÍ³µÄÇå¾²ÐÔºÍÍêÕûÐÔ¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄȨÏÞÖÎÀí  £¬²¢ÇÒͨ¹ý´úÂëʾÀýÀ´×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·ºÍʵ¼ù¡£

Ò»¡¢ÏàʶLinuxȨÏÞÄ£×Ó

ÔÚLinuxÖÐ  £¬Ã¿¸öÎļþºÍĿ¼¶¼ÓÐÒ»×éȨÏÞ  £¬ÒÔ¾öÒéÓû§¶ÔÆäµÄ»á¼ûȨÏÞ¡£Ö÷ÒªÓÐÈý¸ö·ÖÀàµÄȨÏÞ£ºËùÓÐÕߣ¨owner£©¡¢Í¬×éÓû§£¨group£©ºÍÆäËûÓû§£¨others£©¡£Ã¿¸ö·ÖÀàµÄȨÏÞÓÖ¿Éϸ·ÖΪ¶ÁÈ¡£¨r£©¡¢Ð´È루w£©ºÍÖ´ÐУ¨x£©ÈýÖÖȨÏÞ¡£È¨ÏÞ»®·Ö¶ÔÓ¦µÄÊý×ÖֵΪ4¡¢2ºÍ1  £¬¿ÉÒÔ×éºÏʹÓá£ÀýÈç  £¬rwx£¨¶Á¡¢Ð´¡¢Ö´ÐУ©¶ÔÓ¦Êý×ÖȨÏÞֵΪ7  £¬r-x£¨¶Á¡¢²»Ð´¡¢Ö´ÐУ©¶ÔÓ¦Êý×ÖȨÏÞֵΪ5¡£

ÀýÈç  £¬ÎÒÃÇ¿ÉÒÔÓÃÒÔÏÂÏÂÁîÉó²éÒ»¸öÎļþµÄÏêϸȨÏÞÐÅÏ¢£º

$ ls -l file.txt
-rw-r--r-- 1 user group 1024 Sep 30 10:00 file.txt

µÇ¼ºó¸´ÖÆ

ÉÏÊöÊä³öЧ¹ûÖÐ  £¬µÚÒ»ÁÐÖеġ°-rw-r–r–¡±ÌåÏÖÎļþµÄȨÏÞ¡£ÆäÖÐ  £¬µÚһλÌåÏÖÎļþÀàÐÍ  £¬½ÓÏÂÀ´µÄÈýλÊÇËùÓÐÕßµÄȨÏÞ  £¬ÔÙ½ÓÏÂÀ´µÄÈýλÊÇͬ×éÓû§µÄȨÏÞ  £¬×îºóµÄÈýλÊÇÆäËûÓû§µÄȨÏÞ¡£

¶þ¡¢Ê¹ÓÃAccess Control List£¨ACL£©À©Õ¹È¨ÏÞ¿ØÖÆ

ÔÚLinuxÖÐ  £¬Access Control List£¨ACL£©ÊÇÒ»ÖÖÀ©Õ¹È¨ÏÞ¿ØÖÆ»úÖÆ  £¬¿ÉÒÔΪÏêϸµÄÓû§»òÓû§×é·ÖÅÉÖ¸¶¨µÄȨÏÞ¡£ACL¿ÉÒÔʵÏÖÔ½·¢ÎÞаºÍϸÁ£¶ÈµÄȨÏÞ¿ØÖÆ¡£

Ê×ÏÈ  £¬ÎÒÃÇÐèҪȷ±£ÒѾ­×°ÖÃÁËACL¹¤¾ß°ü¡£ÔÚDebian/UbuntuϵͳÉÏ  £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

$ sudo apt-get install acl

µÇ¼ºó¸´ÖÆ

ÔÚCentOS/RHELϵͳÉÏ  £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

$ sudo yum install acl

µÇ¼ºó¸´ÖÆ

½ÓÏÂÀ´  £¬ÎÒÃÇÀ´ÑÝʾÔõÑù¸øÖ¸¶¨Óû§ÊÚÓèÎļþ¶ÁдȨÏÞ¡£¼ÙÉèÎÒÃÇÓÐÒ»¸öÎļþfile.txt  £¬ÎÒÃÇÏëÒª¸øÓû§johnÊÚÓè¶ÁдȨÏÞ¡£

Ê×ÏÈ  £¬ÐèÒª½«ÎļþËùÔÚµÄÎļþϵͳ¹ÒÔØΪ֧³ÖACL¡£ÕÒµ½ÎļþËùÔڵķÖÇø  £¬Ê¹ÓÃÒÔÏÂÏÂÁî¹ÒÔØ£º

$ sudo mount -o remount,acl /dev/sdaX /mnt

µÇ¼ºó¸´ÖÆ

ÆäÖÐ  £¬/dev/sdaXÊÇÄ¿µÄ·ÖÇøµÄ×°±¸Ãû³Æ  £¬/mntÊǹÒÔصã¡£

È»ºó  £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîΪÎļþÉèÖÃACL£º

$ sudo setfacl -m u:john:rw file.txt

µÇ¼ºó¸´ÖÆ

ÒÔÉÏÏÂÁîÖÐ  £¬-mÌåÏÖÐÞ¸ÄACL  £¬u:johnÌåÏÖΪÓû§johnÌí¼ÓACL  £¬rwÌåÏÖ¶ÁдȨÏÞ¡£Ê¹ÓÃgetfaclÏÂÁî¿ÉÒÔÉó²éÎļþµÄACLÐÅÏ¢£º

$ getfacl file.txt
# file: file.txt
# owner: user
# group: group
user::rw-
user:john:rw-
group::r--
mask::rw-
other::r--

µÇ¼ºó¸´ÖÆ

ÆäÖÐ  £¬user::rw-ÌåÏÖËùÓÐÕßµÄȨÏÞ  £¬user:john:rw-ÌåÏÖÓû§johnµÄȨÏÞ  £¬group::r–ÌåÏÖͬ×éÓû§µÄȨÏÞ  £¬mask::rw-ÌåÏÖ×î´óȨÏÞ  £¬other::r–ÌåÏÖÆäËûÓû§µÄȨÏÞ¡£

¼ÌÐøÔĶÁÇë»á¼û [https://linux.cn/article-12863-1.html](https://linux.cn/article-12863-1.html)

ÒÔÉϾÍÊÇÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄȨÏÞÖÎÀíµÄÏêϸÄÚÈÝ  £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí  £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø  £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È  £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ  £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢  £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢  £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

13452372176

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå  £¬9:30-18:30  £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ