서버이전시 권한변경해도 퍼미션에러 발생하는경우
이번에 scp로 원격지에서 파일복사해왔더니 해당문제 발생하여 미세팁 남깁니다.
data폴더내 권한을 아무리 바꿔도 인식이 안되는문제였습니다.
구글링해서 찾아보니 RHEL/CentOS 7 부터는 httpd_sys_rw_content_t 가 있어야 SELinux 가 접근을 허용하지만 PHP 의 파일 세션 디렉터리(/var/lib/php/session/) 에 해당 context 를 부여하지 않는다는 내용이 있어 해당 명령어로 권한부여이후 정상동작함을 확인하였습니다.
아래는 명령어입니다.
#chcon -R -t httpd_sysrw_content_t data폴더
댓글 4개
5년 전
SELinux 그냥 끄고 쓰는게 좋지 않나요?
이것과 관련된게 너무 많아서,,, 일일이 체크가 어렵네요.
이것과 관련된게 너무 많아서,,, 일일이 체크가 어렵네요.
Lemios
5년 전
저도 그게 편하긴 한데 아무래도 보안때문에 문제생긴 케이스를 몇번 경험하다보니 조심하는게 좋겟다는 생각이 듭니다.
4년 전
서버 이전 후 권한 707 아무리해도 로그인이 되지 않고 켑챠 이미지도 보이지 않아서...
centos 7 인부분을 보니 저도 selinux 때문인것 같은데...
말씀하신 명령어를
#chcon -R -t httpd_sysrw_content_t data
했는데요
아래처럼 실패로 뜨는데.. 혹시 조언좀 얻을 수 있을까요? ㅠㅠ
chcon: failed to change context of ‘1612’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘editor’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘faq’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘dbconfig.php’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘member’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘data’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
centos 7 인부분을 보니 저도 selinux 때문인것 같은데...
말씀하신 명령어를
#chcon -R -t httpd_sysrw_content_t data
했는데요
아래처럼 실패로 뜨는데.. 혹시 조언좀 얻을 수 있을까요? ㅠㅠ
chcon: failed to change context of ‘1612’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘editor’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘faq’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘dbconfig.php’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘member’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
chcon: failed to change context of ‘data’ to ‘unconfined_u:object_r:httpd_sysrw_content_t:s0’: Invalid argument
Lemios
4년 전
보안설정 바꾸는 방법도 참고해보세요
https://m.blog.naver.com/PostView.nhn?blogId=thierry17&logNo=220617319341&proxyReferer=https:%2F%2Fwww.google.com%2F
https://m.blog.naver.com/PostView.nhn?blogId=thierry17&logNo=220617319341&proxyReferer=https:%2F%2Fwww.google.com%2F
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2694 | 2개월 전 | 188 | ||
| 2693 | 2개월 전 | 148 | ||
| 2692 | 2개월 전 | 158 | ||
| 2691 | 2개월 전 | 174 | ||
| 2690 | 2개월 전 | 326 | ||
| 2689 | 2개월 전 | 233 | ||
| 2688 |
|
2개월 전 | 441 | |
| 2687 | 2개월 전 | 292 | ||
| 2686 |
선택과집중
|
2개월 전 | 329 | |
| 2685 | 2개월 전 | 291 | ||
| 2684 | 2개월 전 | 346 | ||
| 2683 | 2개월 전 | 481 | ||
| 2682 | 2개월 전 | 276 | ||
| 2681 | 2개월 전 | 302 | ||
| 2680 |
선택과집중
|
2개월 전 | 278 | |
| 2679 | 2개월 전 | 330 | ||
| 2678 |
|
3개월 전 | 429 | |
| 2677 |
|
3개월 전 | 502 | |
| 2676 | 3개월 전 | 326 | ||
| 2675 | 3개월 전 | 304 | ||
| 2674 |
선택과집중
|
3개월 전 | 480 | |
| 2673 |
|
3개월 전 | 322 | |
| 2672 | 3개월 전 | 335 | ||
| 2671 | 3개월 전 | 284 | ||
| 2670 | 3개월 전 | 260 | ||
| 2669 | 3개월 전 | 374 | ||
| 2668 | 3개월 전 | 289 | ||
| 2667 |
선택과집중
|
3개월 전 | 484 | |
| 2666 |
선택과집중
|
3개월 전 | 470 | |
| 2665 |
선택과집중
|
3개월 전 | 404 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기