סקונילב (השיג תרקב תומישר) השיג תרקב תומישר תועצמאב תוירפס/םיצבק חטבא


.ומשוי (ACL) השיג תרקב תומישר ,ךכיפל .ץבוק וא הירפס התואב םינוש םישמתשמ רובע תונוש תואשרה תוכרע רידגהל םילוכי ונניא ,אמגודל .ונלש םיכרצל םאתהב דובעל תולוכי ןניא םיתעלו תמיוסמ הלבגמ שי לדחמ

.ךכל השיג היהת אל רחא דחא ףאלו 'tecmint1' תולעבבש םיצבקל תשגלו אורקל לכוי 'tecmint2' שמתשמה קרש הצור 'tecmint1' שמתשמה .'acl' םירמוא תפתושמ הצובק םהמ דחא לכל .'tecmint3' -ו 'tecmint1', 'te

.שמתשמה לש תוצובקה תמישרב םיאצמנ םניאש םישמתשמ לש הצובק לכלו הצובקל ,שמתשמל תואשרה קינעהל ונל תורשפאמ הלא השיג תומישר .קירטה ותוא תא תושעל ונל תורשפאמ (השיג תרקב תומישר) השיג תרקב תומישר

.NFS תואצוימ םיצבק תוכרעמו ext3 םיצבק תוכרעמ רובע ACL -ב הכימת קפסמ אוה ,Redhat לש רצומה דועיתל םאתהב :הרעה

סקוניל תוכרעמב ACL תכימת קודבל דציכ

.תויחכונ םיצבק תוכרעמב ACL -ב הכימת לבקל רומא התא ,ךישמתש ינפל

.(שדחמ רודיה עצבל ךרוצ שיו ACL -ב ךמות וניא Kernel -ש רמוא הז זא ,Y םוקמב N שי םא) POSIX_ACL = Y תורשפאו םיצבק תכרעמ רובע ACL -ב הכימת קודבל ידכ האבה הדוקפה תא לעפה

 grep -i acl /boot/config*

CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_JFS_POSIX_ACL=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FS_POSIX_ACL=y
CONFIG_GENERIC_ACL=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_CIFS_ACL=y
CONFIG_9P_FS_POSIX_ACL=y

.apt-get וא yum תועצמאב ןיקתהל שיש תושרדנה תוליבחה ןלהל .תושרדנ תוליבח תנקתהש אדוו ACL תומישר םע קחשל ליחתתש ינפל

 yum install nfs4-acl-tools acl libacl		[on RedHat based systems]
 mount  | grep -i root

/dev/mapper/fedora-root on / type ext4 (rw,relatime,data=ordered)

.הבכרהל לדחמה תרירב תורשפא םע תבלושמ תויהל היושע איה הנורחאה תכרעמבש ןוויכמ ,אל וא acl תורשפא םע תנקתומ הציחמהש אדוול תפסונ תורשפא ונל שי ,המידק ךישמנש ינפל לבא .acl תורשפא תועצמאב בוש תנק

 tune2fs -l /dev/mapper/fedora-root | grep acl

Default mount options:    user_xattr acl

.ןלהל גצומכ הציחמה תא שדחמ תולעהל איה תפסונ תורשפא .acl -ב תכמות רבכ הבכרה לש לדחמה תרירב תורשפא יכ תוארל ולכות ליעלש טלפב

 mount -o remount,acl /

.עובקל ותוא ךופהל ידכ 'etc/fstab /' ץבוקל ןלהלש ךרעה תא ףסוה ,ןכמ רחאל

/dev/mapper/fedora-root /	ext4    defaults,acl 1 1

.הציחמה תא שדחמ ביכרה ,בוש

 mount -o remount  /

.תוחוקלה תכרעמ ידי לע םישמשמ ACL זא ,NFS תוחוקל ידי לע ,ACL -ו ACL -ב תכמות NSF תרש ידי לע תאצוימה םיצבק תכרעמ אורקל ןתינ םא ,NFS תרשב

.רהה ךלהמב "no_acl"\תורשפאב בוש שמתשה NSF חוקלה דצב התוא תיבשהל ידכ .NFS תרשב ‘etc/exportfs /‘ ץבוקב "no_acl"\תורשפא ףיסוהל ךילע ,NFS ףותישב השיג תרקב תומישר תתבשה םשל

סקוניל תוכרעמב ACL -ב הכימת םשייל דציכ

:ACL לש םיגוס ינש םנשי

    :לדחמ תרירב ACL ןיבל ACL השיג ןיב לדבהה

      .'הקיסומ' היקיתל ACL תומישר לש לדחמה תרירב תלבקל שמשמ getfacl -ה ,ןלהלש המגודב .'getfacl' הדוקפב שמתשה ,םייפיצפס היירפס וא ץבוק רובע השיג תרקב תומישר לש לדחמה תרירב תא עובקל ידכ

       getfacl Music/
      
      # file: Music/
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x
      default:user::rwx
      default:group::r-x
      default:other::rw-

      .'הקיסומ' היקיתב (לעופל איצוהלו אורקל) םישדח ACLs רידגת setfacl הדוקפה ,ןלהלש המגודב .'setfacl' הדוקפב שמתשה ,םייפיצפס היירפס וא ץבוק רובע לדחמ תרירבכ תורדגומה ACL -ה תומישר תא רידגהל ידכ

       setfacl -m d:o:rx Music/
       getfacl Music/
      # file: Music/
      # owner: root
      # group: root
      user::rwx
      group::r-x
      other::r-x
      default:user::rwx
      default:group::r-x
      default:other::r-x

      .'tecmint1' שמתשמל הביתכו האירק תואשרה תתל ,אמגודל .הירפס וא ץבוק לכב יוניש וא הרדגהל 'setfacl' הדוקפב שמתשה

      # setfacl -m u:tecmint1:rw /tecmint1/example

      .הטמל הדוקפב שמתשה 'tecmint1/example /' -ב ACL גיצהל ידכ ,המגודל .היירפס וא ץבוק לכב ACL -ב הייפצל 'getfacl' הדוקפב שמתשה

      # getfacl /tecmint1/example
      
      # file: tecmint1/example/
      # owner: tecmint1
      # group: tecmint1
      user::rwx
      user:tecmint1:rwx
      user:tecmint2:r--
      group::rwx
      mask::rwx
      other::---

      .ןלהל גצומכ b -ו x תויורשפאב םישמתשמ ונא ,הירפס/ץבוק לכמ ACL תרסהל

      # setfacl -x ACL file/directory  	# remove only specified ACL from file/directory.
      
      # setfacl -b  file/directory   		#removing all ACL from file/direcoty

      .םיאבה םישיחרתב ACL תא םשיינ ואוב

      .'tecmint2' שמתשמל וז היירפסב עוציבהו האירקה תאשרה תא קפסנו 'tecmint1' תולעבב תחא הירפס רוצינ .'acl' םשב תפתושמ תינשמ הצובק םהינשל ,(tecmint2 -ו tecmint1) םישמתשמ ינש

      םהינשמ המסיס רסהו םישמתשמ ינש רוצ :1 בלש

       for user in tecmint1 tecmint2
      
      > do
      > useradd $user
      > passwd -d $user
      > done
      Removing password for user tecmint1.
      passwd: Success
      Removing password for user tecmint2.
      passwd: Success

      .תינשמ הצובקל םישמתשמו הצובק רוצ :2 בלש

       groupadd acl
       usermod -G acl tecmint1
       usermod -G acl tecmint2

      .tecmint1 -ל תולעב הנשו tecmint/ךירדמ רוצ :3 בלש

       mkdir /tecmint1
       chown tecmint1 /tecmint1/
       ls -ld /tecmint1/
      
      drwxr-xr-x 2 tecmint1 root 4096 Apr 17 14:46 /tecmint1/
       getfacl /tecmint1
      
      getfacl: Removing leading '/' from absolute path names
      # file: tecmint1
      # owner: tecmint1
      # group: root
      user::rwx
      group::r-x
      other::r-x

      .tecmint/-ב היקית רוצו tecmint1 תועצמאב רבחתה :4 בלש

      [[email  ~]$ su - tecmint1
      
      Last login: Thu Apr 17 14:49:16 IST 2014 on pts/4
      [[email  ~]$ cd /tecmint1/
      [[email  tecmint1]$ mkdir example
      [[email  tecmint1]$ ll
      
      total 4
      drwxrwxr-x 2 tecmint1 tecmint1 4096 Apr 17 14:50 example
      [[email  tecmint1]$ whoami 
      tecmint1

      .תואשרה ילעב ויהי אל םירחאו 'המגוד' היקיתב קר האירק תאשרה היהת tecmint2 -ל ,rwx תואשרהה לכ ויהי tecmint1 -לש ךכ ,'setfacl' תועצמאב ACL תא ורידגה תעכ :5 בלש

      $ setfacl -m u:tecmint1:rwx example/
      $ setfacl -m u:tecmint2:r-- example/
      $ setfacl -m  other:--- example/
      $ getfacl example/
      
      # file: example
      # owner: tecmint1
      # group: tecmint1
      user::rwx
      user:tecmint1:rwx
      user:tecmint2:r--
      group::r-x
      mask::rwx
      other::---

      .ןלהל לדבהה תא תוארלו הירפס תונשל הסנ זאו 'ls' הדוקפה תועצמאב ןכותה תא גיצהל הסנ תעכ .'tecmint1 /' ל היירפס הנשו רחא ףוסמב 'tecmint2' רמולכ רחא שמתשמ םע רבחתה תעכ :6 בלש

      [[email  ~]$ su - tecmint2
      
      Last login: Thu Apr 17 15:03:31 IST 2014 on pts/5
      [[email  ~]$ cd /tecmint1/
      [[email  tecmint1]$ ls -lR example/
      example/:
      total 0
      [[email  tecmint1]$ cd example/
      
      -bash: cd: example/: Permission denied
      
      [[email  tecmint1]$ getfacl example/
      
      # file: example
      # owner: tecmint1
      # group: tecmint1
      user::rwx
      user:tecmint1:rwx
      user:tecmint2:r--
      group::rwx
      mask::rwx
      other::---

      .רבד תביתכל תואשרה ןיא ךא ,היירפס תונשלו גיצהל תואשרה שי 'tecmint2' -ל תעכ .העפשהה תא תוארל ידכ 'cd' הדוקפב שמתשה זאו 'המגוד' היקיתב 'tecmint2' -ל 'עוציב' תאשרה ןת תעכ :7 בלש

      [[email  tecmint1]$ setfacl -m u:tecmint2:r-x example/
      [[email  tecmint1]$ getfacl example/
      
      # file: example
      # owner: tecmint1
      # group: tecmint1
      user::rwx
      user:tecmint1:rwx
      user:tecmint2:r-x
      group::rwx
      mask::rwx
      other::---
      [[email  ~]$ su - tecmint2
      
      Last login: Thu Apr 17 15:09:49 IST 2014 on pts/5
      [[email  ~]$ cd /tecmint1/
      [[email  tecmint1]$ cd example/
      [[email  example]$ getfacl .
      [[email  example]$ mkdir test
      
      mkdir: cannot create directory ‘test’: Permission denied
      
      [tecmint[email  example]$ touch test
      
      touch: cannot touch ‘test’: Permission denied
      

      .ןלהל טרופמכ 'ls –l' טלפל ףסונ '+' ןמיס הארת ,ACL תעמטה רחאל :הרעה

       ll
      
      total 4
      drwxrwx---+ 2 tecmint1 tecmint1 4096 Apr 17 17:01 example

      הינפה ירושיק

      ACL לש דועיתה