# visudo ^ This edits “/etc/sudoers” file. Added the following lines.
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”.
* * 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.