get ip of user executed program
In my kernel module driver, during the execution of program (e.g mkdir) I need to find out the IP of the currently logged in client that executed this program.
One solution is to climb up in the process tree, go to init process, then start going down in the process tree, look for sshd, cross between the user id and the sshd session, perform a netstat and get the Foreign Address.
Is the a better efficient way to get the ip of the user ?
|