Tech.blog
About Linux File Permissions
2021.08.23
thumbnail
#Linux
#chmod

Permissions

Shell에서 ls -l을 통해 디렉토리 정보를 확인할 수 있다. 가장 처음에 확인할 수 있는 권한에 대해 알아보자.

📒File Type

** : regular file **

  • touch명령어로 만들어진 파일, 가장 흔하게 볼 수 있는 파일 타입

** d : directory **

  • 디렉토리

** c : character device file **

  • Character and block device files allow users and programs to communicate with hardware peripheral devices

** b : block device file **

  • Block devices are similar to character devices. They mostly govern hardware as hard drives, memory, etc.

** s : local socket file **

  • Local domain sockets are used for communication between processes. Generally, they are used by services such as X windows, syslog and etc.

**p : named pipe **

  • Similarly as Local sockets, named pipes allow communication between two local processes.

** l : symbolic link **

  • With symbolic links an administrator can assign a file or directory multiple identities. Symbolic link can be though of as a pointer to an original file.

❗️permission 수정에 대해 알아보기전에 권한 그룹에 대해 알아보자.

  • owner : 파일의 owner에 대한 권한
  • group : 그룹에 대한 권한
  • all users : 모든 사용자에 대한 권한

📒read(읽기), write(생성, 삭제, 수정), execute(실행) 권한 수정

🔍Symbolic method

  • 레퍼런스 : chmod [옵션] [레퍼런스][연산자][권한] [파일또는폴더]
chmod a+rw myfile

위와같이 입력한다면 myfile의 권한은 rw-rw-rw로 바뀜


🔍Absolute form

  • 레퍼런스 : chmod [옵션] [소유자권한][그룹권한][그외사용자권한] [파일또는폴더]
chmod 751 myfile

위와같이 입력한다면

  • user : read, write, execute
  • group : read, execute
  • others : execute

출처


© 2022. Tech Blog