|
I setup the same scenario and it worked for me on Solaris 8 but with small change.
1. Setup password-less ssh for user "user-A" from box-A to box-B
2. setup the sudoers (/usr/local/etc/sudoers as sudo installed from SMCsudo) on box-B as below:
User_Alias USERA = user-A
Cmnd_Alias SU_USERA = /bin/test_scr.sh
USERA ALL = (ALL) NOPASSWD: SU_USERA
where "/bin/test_scr.sh" would have the below line (root must be the owner of this script)
su - user-B -c "/opt/rah/rah/rah/command.sh"
3. run the below command from box-A as user user-A
ssh box-B "/usr/local/bin/sudo /bin/test_scr.sh"
Note: On box-B, /bin/test_scr.sh will be run as "root" user who in turn "su" to user-B (root -to- user-B does not require any password)
DONE
Prvn
|