2 Replies Latest reply: Nov 13, 2012 11:20 AM by 898553 RSS

    run shell script as sudo user without giving sudo passowrd from normal usr

    techshell81
      Hi ,

      i am running shell script from my account with sudo user what is the problem in my procedure.

      Please if any thing wrong in my procedureprocedure or any permission required please let me know.


      here is the my procedure and sudo permissions.


      [techm@ppsol04 ~]$ sudo su - dadm sudo -u dadm /u01/ora/tools/Dbmon/scripts/export.sh
      Sorry, user techm is not allowed to execute '/u01/ora/tools/Dbmon/scripts/export.sh' as dadm on ppsol04.
      [dchandu@ppsol04 ~]$ sudo -l
      Matching Defaults entries for techm on this host:
      env_keep=SSH_AUTH_SOCK, !authenticate, env_reset, always_set_home, !requiretty


      sudo permissions :



      sudo -l
      Matching Defaults entries for techm on this host:
      env_keep=SSH_AUTH_SOCK, !authenticate, env_reset, always_set_home, !requiretty

      User techm may run the following commands on this host:
      (ALL) NOPASSWD: /local/bin/hardened_profile.sh
      (root) NOPASSWD: /bin/su - dora
      (root) NOPASSWD: /bin/su - doraadm
      (root) NOPASSWD: /bin/su - docenter
      (root) NOPASSWD: /bin/su - tora
      (root) NOPASSWD: /bin/su - toraadm
      (root) NOPASSWD: /bin/su - tocenter
      (root) NOPASSWD: /bin/su - hora
      (root) NOPASSWD: /bin/su - horaadm
      (root) NOPASSWD: /bin/su - hocenter
      (root) NOPASSWD: /bin/su - agcfdwf4
      (root) NOPASSWD: /bin/su - pora
      (root) NOPASSWD: /bin/su - dadm
      (root) NOPASSWD: /bin/su - pocenter
      (root) NOPASSWD: /bin/su - agcfdwp4


      Thanks
      tech