Get the public IP of a user on the system
by JohnLocker from LinuxQuestions.org on (#4YZ7V)
Hello!
I am writing a kernel driver as part of an attempt to better understand the Linux project, and one of the things that I wanted to do is to log file access of every process from kernel. At the same time though, I want to log the IP of the user that accesses a particular file. Is it possible to get that ?
For example, let's say that I have hooked sys_write. When a process calls it, I will be able to get the UID of the user that gave the order to write to a particular file. Is it possible to find his public IP address from kernel using his UID ?
Thanks in advance!


I am writing a kernel driver as part of an attempt to better understand the Linux project, and one of the things that I wanted to do is to log file access of every process from kernel. At the same time though, I want to log the IP of the user that accesses a particular file. Is it possible to get that ?
For example, let's say that I have hooked sys_write. When a process calls it, I will be able to get the UID of the user that gave the order to write to a particular file. Is it possible to find his public IP address from kernel using his UID ?
Thanks in advance!