Hi,
i have requirement to find logged in user based on process id. i have below scenario.
- all my users will logon to unix box using ssh from windows system.
- after successful logon they will sudo to common user. ex. sudo -su edadm
lot of users are executing jobs from edadm user and want to find out who executed particular job.
using ps -eaf command i am able to find out process id and user name but that is displaying edadm user. But i want to know actual user name who logged on to system and executed that particular script.
Ex. User1 is logged into unixbox and executed sudo su - edadm and executed script1.
edadm 18892 12778 0 04:28 pts/20 00:00:00 script1
I am able to see edadm user is executing script1 but my expectation is to find out USER1 because he is the one who is executing script.