2012-12-17 2 views
0

배경 :의 sudoers는 rvmsudo 승객 설치 - 아파치 모듈을 신청

나는 갓 매일 배포 된 응용 프로그램이 - VM이 생성되고, 그 시스템의 루트는 "systemuser을"생성을하는 그런 다음 응용 프로그램을 설치합니다.

그것은 실행의 :

  • 에 CentOS 6
  • RVM에게
  • 루비 1.8.7를 레일에
  • 승객

가 최대 설정되어 방법을, 나는 루비가 있어야 레일 자체가 설치되고 승객이 설치됩니다. 이를 위해 서비스를 실행하는 사용자는 sudo 권한을 갖지만 설치하는 동안 필요한 명령 만 허용 할 수 있습니다. 보안 및 유지 관리상의 이유로 우리는 스크립트에 sudo 암호를 넣을 수 없습니다.

내/등 /의 sudoers은 다음과 같습니다

systemuser ALL = NOPASSWD: /usr/bin/env, /bin/bash, /usr/local/rvm/rubies/ruby-1.8.7-p358/bin/gem, /bin/cp, /bin/ln, /bin/mv, /bin/rm, /etc/init.d/httpd * 

이 문제가 :

까지 최근이의 변형이 큰했다. 그러나 최근에 뭔가가 어딘가에 변경 되었습니까? (?) rvmsudo 명령은 암호 프롬프트없이 더 이상 실행되지 않습니다.

$ rvmsudo passenger-install-apache2-module 

We trust you have received the usual lecture from the local System 
Administrator. It usually boils down to these three things: 

    #1) Respect the privacy of others. 
    #2) Think before you type. 
    #3) With great power comes great responsibility. 

[sudo] password for systemuser: 

질문 :

에서 RVM, 루비, 들러/보석을 설치/등 /의 sudoers 일, 다음 아파치에 passenger2해야 명령의 최소한은 무엇입니까?

네, 환영 https://rvm.io/integration/passenger/

크리에이티브 솔루션에서 "문서"를 읽었습니다! 나는 이것이 꽤 해킹 된 시스템처럼 보일지도 모른다는 것을 알고 있으며, 나는 당신과 동의 할 것입니다. 그러나 현재이 승객 설치 스크립트가 어떤 명령을 실행하는지 이해하지 않고도이를 향상시키는 것은 어렵습니다.

전면에서 "ENV"과 "bash는 제거"와 "RVM"을 추가 조금 더 가져옵니다

systemuser ALL = NOPASSWD: /usr/local/rvm/bin/rvmsudo, /usr/local/rvm/gems/ruby-1.8.7-p358/bin/passenger-install-apache2-module, /bin/cp, /bin/ln, /bin/mv, /bin/rm, /etc/init.d/httpd * 

이 실행 : 귀하의 관심

$ rvmsudo passenger-install-apache2-module 
[sudo] password for systemuser: 

감사합니다!

답변

0

/usr/bin/env/bin/bash에 대해 동일한 명령을 실행하도록 허용하는 라우터이므로 which passenger-install-apache2-module을 추가해야합니다.

+0

굉장합니다. 귀하의 충고에 따라이 행을 다음으로 변경했습니다. systemuser ALL = NOPASSWD :/usr/local/rvm/bin/rvmsudo, /usr/local/rvm/gems/ruby-1.8.7-p358/bin/passenger- */bin/mv,/bin/rm, /etc/init.d/httpd * ... 여전히 동일한 결과가 표시됩니다. 아마도 sudo 캐시 같은 것이 있습니까? 나는 sudo를 조금 잃어 버렸다. – MonkeyWidget

+0

당신은 여전히 ​​위험한 명령을 가지고 있습니다 :'systemuser ALL = NOPASSWD : passenger-install-apache2-module,/etc/init.d/httpd *' – mpapis

+0

감사합니다. NOPASSWORD 라인에 있는데도 여전히 passenger-install-apache2-module에 대한 비밀번호를 묻는 이유에 대한 아이디어가 있습니까? – MonkeyWidget