root 로 만든 스크립트가 있는데
이 스크립트를 볼수없게하고 복사도 못하게하면서
user 계정으로 실행만은 가능하게하고싶은데...가능할까요?
툴을 사용하는것도 괜찮습니다.
안되면...시스템콜을 써서 C언어로 만들어야할까요? ㅡㅡ;;
$ chmod a-rw xxx.sh $ chmod a+x xxx.sh
1. root 로 스크립트 생성후 chmod 적용
debian:/home/# chmod a-rw xxx.sh debian:/home/# chmod a+x xxx.sh
2. user 계정으로 실행
user@debian:~$ ./patch.sh couldn't read file "./patch.sh": permission denied
cat 이나 cp 같은것으로 시도하려할때는 안되서 좋아라했는데;; 어렵네요;
쉘스크립트는 실행할 때 읽기 권한이 필요하기 때문에 권한 설정만 가지고는 안되는 군요. 방법이 있다면, 쉘스크립트 컴파일러로 바이너리화 하는 방법 뿐이겠네요. 아래 링크는 쉘스크립트 컴파일러를 받을 수 있는 곳입니다.
http://www.datsi.fi.upm.es/~frosal/
많은 도움이 되었습니다. 감사합니다.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
chmod
$ chmod a-rw xxx.sh
$ chmod a+x xxx.sh
잘안되네요 ㅠㅠ
1. root 로 스크립트 생성후 chmod 적용
debian:/home/# chmod a-rw xxx.sh
debian:/home/# chmod a+x xxx.sh
2. user 계정으로 실행
user@debian:~$ ./patch.sh
couldn't read file "./patch.sh": permission denied
cat 이나 cp 같은것으로 시도하려할때는 안되서 좋아라했는데;; 어렵네요;
앗.. 그렇네요
쉘스크립트는 실행할 때 읽기 권한이 필요하기 때문에 권한 설정만 가지고는 안되는 군요.
방법이 있다면, 쉘스크립트 컴파일러로 바이너리화 하는 방법 뿐이겠네요.
아래 링크는 쉘스크립트 컴파일러를 받을 수 있는 곳입니다.
http://www.datsi.fi.upm.es/~frosal/
감사합니다
많은 도움이 되었습니다. 감사합니다.
댓글 달기