권한 변경이 가능한 경우
OS에 로그인한 사용자와, 폴더나 파일의 소유자가 같을 경우에
명령어 chmod 로 폴더나 파일의 권한을 변경할 수 있다
만약 OS에 로그인한 사용자와, 폴더나 파일의 소유자가 다를 경우에는
관리자 권한을 획득하는 명령어 sudo 를 이용해 폴더나 파일의 권한을 변경할 수 있다
변경 방법
- Symbolic method
더하기(+), 빼기(-), 할당(=)과 액세서 유형을 표기해서 변경
액세스 클래스와 연산자, 액세스 타입을 모두 기억해야만 Symbolic method를 이용해 권한을 변경할 수 있다
예) -r--r--r-- chmod u+w filename 👉 -rw--r--r-- chmod u= filename 👉 ---r--r-- chmod a= filename 👉 --------- chmod u=rwx filename 👉 -rwx----- chmod a+wx filename 👉 -rwx-wx-wx |
- Absolute form
rwx를 3 bit로 해석하여, 숫자 3자리로 권한을 표기해서 변경
# u=rwx (4 + 2 + 1 = 7), go=r (4 + 0 + 0 = 4) chmod 744 helloworld.js 👉 -rwxr--r-- |



Manage file permissions on Unix-like systems
On this page: Overview Unix-like operating systems, such as Linux, running on shared high-performance computers use settings called permissions to determine who can access and modify the files and directories stored in their file systems. Each file and dir
kb.iu.edu
'리눅스' 카테고리의 다른 글
리눅스 환경변수 2) 환경변수 사용하기 - dotenv.config() (0) | 2021.10.05 |
---|---|
리눅스 환경변수 1) 설정 및 조회 (0) | 2021.10.05 |
리눅스 사용권한 1) 리눅스 실행과 읽기 권한 차이 (0) | 2021.10.05 |
댓글