'how to link the pbrun session to the originating session?

ssh host1 -l user1
who am i
$ user1    pts/5 
pbrun su - service1
who am i
$ service1     /dev/pts/2

So how can service1 session determine that is was launched by user1?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source