![mod_php를 통해 웹 서버(Apache)에서 Sudo를 마운트하면 결과가 루트에 표시되지 않습니다.](https://linux55.com/image/3390/mod_php%EB%A5%BC%20%ED%86%B5%ED%95%B4%20%EC%9B%B9%20%EC%84%9C%EB%B2%84(Apache)%EC%97%90%EC%84%9C%20Sudo%EB%A5%BC%20%EB%A7%88%EC%9A%B4%ED%8A%B8%ED%95%98%EB%A9%B4%20%EA%B2%B0%EA%B3%BC%EA%B0%80%20%EB%A3%A8%ED%8A%B8%EC%97%90%20%ED%91%9C%EC%8B%9C%EB%90%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
기본적으로 PHP 스크립트가 있습니다.
exec('sudo mount /dev/md/stone:supershare /mnt/supershare');
오류 없이 완료되었으며 종료 코드는 0입니다.
root
별도의 세션 에서는 cat /proc/mounts
나도 아니고 그것도 나의 흔적을 보이지 않았습니다 supsershare
.
노력하다 root
:rm -r /mnt/supershare
[root@stone mnt]# rm -r supershare/
rm: cannot remove ‘supershare/’: Device or resource busy
노력하다 root
:umount /mnt/supershare
[root@stone mnt]# umount /mnt/supershare
umount: /mnt/supershare: not mounted
노력하다 root
:mdadm --stop /dev/md/stone:supershare
[root@stone mnt]# mdadm --stop /dev/md/stone\:supershare
mdadm: Cannot get exclusive access to /dev/md/stone:supershare:Perhaps a running process, mounted filesystem or active volume group?
웹 서버에서 sudo를 사용하여 동일한 명령을 실행하려는 모든 시도는 성공합니다(마운트 지점 표시 표시, 장치 마운트 해제, 공격 중지 등).
예, 저는 루트입니다:
[root@stone mnt]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),19(log)
root
웹 서버에서 수행한 설치에 대해 알림을 받지 못하는 이유는 무엇 입니까?
어떤 시나리오에서 mount
현지화가 효과적인 사용자가 될까요?
답변1
요컨대,문제가 해결되었습니다..
이것은 Apache의 해당 서비스입니다 systemd
.PrivateTmp=true
지시하다. 분명히 이 명령어는 새로운 파일 시스템 네임스페이스를 사용하여 프로세스를 실행합니다.
문제 해결 모험에 대해 자세히 알아볼 수 있습니다.여기.