반응형
리눅스 설정 값 중에 로그 파일들 권한을 설정해주는 파일이 있어서 그렇다.
/lib/tmpfile.d/var.conf
여기서 수정하면 리붓해도 설정한 권한으로 유지된다.(테스트 완료)
How to change default file permissions for /var/log/wtmp?
SOLUTION VERIFIED - Updated April 21 2023 at 3:17 AM -
Environment
- Red Hat Enterprise Linux (RHEL) 7
- Red Hat Enterprise Linux (RHEL) 8
Issue
- How to permanently change the default file permissions for /var/log/wtmp ?
Resolution
For RHEL 7.3
- Permissions for the /var/log/wtmp file is handled by /lib/tmpfiles.d/var.conf, which gets executed after every reboot.
- To change default permissions, edit the permissions in below script.
-
# cat /lib/tmpfiles.d/var.conf | grep wtmp f /var/log/wtmp 0664 root utmp -
For RHEL 7.0, 7.1, 7.2
- Permissions for the /var/log/wtmp file is handled by /lib/tmpfiles.d/systemd.conf, which gets executed after every reboot.
- To change default permissions, edit the permissions in below script.
-
# cat /lib/tmpfiles.d/systemd.conf | grep wtmp f /var/log/wtmp 0664 root utmp -
NOTE: If a custom file /etc/tmpfiles.d/var.conf is created in /etc/tmpfiles.d/ directory, then irrespective of the RHEL version the file will take precedence over same file in /lib/tmpfiles.d/ directory.
반응형
'Linux' 카테고리의 다른 글
원격 서버 root 권한으로 명령어 실행하고 싶을 때 (0) | 2023.09.19 |
---|---|
grafana timerange 전역변수 활용(timefrom, timeto) (0) | 2023.09.18 |
linux command - bc (0) | 2023.05.17 |
linux command - basename (0) | 2023.05.17 |
linux command - attr (0) | 2023.05.13 |
댓글