digiturf.net

sudo permission to jdapp (sudo su – jdapp) for chkprod user.

# visudo             ^ This edits “/etc/sudoers” file. Added the following lines.

Cmnd_Alias JDAPP=/u01/app/jd-apps/bin/jdapp.sh
chkprod ALL=(jdapp) NOPASSWD: JDAPP,/bin/bash  ^Allowing “chkprod” to su as “jdapp” and he can execute “jdapp.sh” and given access to “Bash shell”.

 NOTES :

* * su will always prompt for password. Entering the password for chkprod when running ” # sudo su – jboss “ will allow changing to the jdapp user.
* * Running ” sudo -u jboss /bin/bash ” as chkprod will allow the change to jdapp user without entering password.

Leave a Reply