리눅스-기초명령어/파일 및 유저 권한 (5) 썸네일형 리스트형 ACL (Access Control List) *활용도는 높으나 실제로 실무에서는 제한되어 사용됨 접근제어 목록의 약자이며 user,group,orher 영역의 권한을 부여할수 있게 만들어준다. 일반적으로 어떠한 파일에 특정 사용자나 그룹에 권한을 부여하려면 소유권한을 넘기고 다시 허가권을 부여하는 절차가 필요한데 이 문제점을 해결할 수 있는 것이 ACL이다. 1. getfacl 파일이나 디렉토리에 설정된 접근권한 리스트를 확인하는 명령 사용법 getfacl [옵션] 파일명 [root@Linux ~]# getfacl /etc/passwd getfacl: Removing leading '/' from absolute path names # file: etc/passwd d # owner: root # group: root user::rw- group:.. umask 자동으로 부여되는 허가권의 디폴트값 변경 파일이나 디렉토리를 생성할 때 자동으로 기본 허가권이 부여되는데 그 기본 허가권을 변경하여 새로 만들어지는 파일이나 디렉토리에 자동으로 수정된 권한을 부여한다. 부여되는 권한 = 기본 허가권 - umask값 리눅스의 기본 허가권 파일 : 666 디렉토리 : 777 umask 확인하는 방법 [root@Linux test]# umask 0022 umask 변경하는 방법 [root@Linux test]# umask 077 [root@Linux test]# umask 0077 사용 예시 [root@Linux test]# umask 077 [root@Linux test]# touch B [root@Linux test]# ll total 0 -rw-------. 1 root.. chgrp 파일이나 디렉토리의 소유 그룹을 변경 chgrp [옵션] [바꿀 그룹명] [소유권을 변경할 파일 및 디렉토리] [root@localhost ~]# ll total 12 -rw-------. 1 root root 830 May 22 14:45 anaconda-ks.cfg -rw-r--r--. 1 root root 0 May 30 12:56 A.txt ... [root@localhost ~]# chgrp wheel A.txt [root@localhost ~]# ll total 12 -rw-------. 1 root root 830 May 22 14:45 anaconda-ks.cfg -rw-r--r--. 1 root wheel 0 May 30 12:56 A.txt ... 해당 A.txt 가 하위 그룹이 roo.. chown 파일 및 디렉토리에 대한 소유권을 변경 chown [옵션] [user:group] [파일] 옵션 -R : 하위 파일의 소유자 ,소유그룹을 전부 변경한다 [root@Linux ~]# chown -R admin AAA [root@Linux ~]# ll total 56 drw-rwxr-x. 2 admin root 45 Apr 27 12:25 AAA [root@Linux ~]# cd AAA [root@Linux AAA]# ll total 0 -rw-r-----. 1 admin admin 0 Apr 27 12:25 A.txt -rw-r-----. 1 admin root 0 Apr 27 12:25 B.txt -rw-r-----. 1 admin root 0 Apr 27 12:25 C.txt 소유자 권한이 전부 adm.. chmod 파일 및 디렉토리에 대한 허가권을 변경 chmod [옵션] [접근권한] [파일명] 옵션 -R : 특정 디렉토리 내의 파일과 디렉토리에 대해 재귀적으로 변경 [root@Linux AAA]# ls A.txt B.txt C.txt [root@Linux AAA]# ll total 0 -rw-r--r--. 1 root root 0 Apr 27 12:25 A.txt -rw-r--r--. 1 root root 0 Apr 27 12:25 B.txt -rw-r--r--. 1 root root 0 Apr 27 12:25 C.txt [root@Linux ~]# chmod -R u+x AAA # AAA디렉토리에 대해 유저에게 x권한을 반복해서 변경한다 -> AAA 디렉토리 하위 파일 및 디렉토리에 적용 [root@Linux .. 이전 1 다음