[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Retrieving tcp socket port in PAM module



Hi, 
I am invoking my own login shell /bin/myshell once  PAM authentication is successfull. 

My login shell, /bin/myshell requires remote ip (of client) , remote port (socket opened on node, where PAM module is sitting. 

I could get remote host, from PAM_RHOST

retval = pam_get_item(pamh, PAM_RHOST, (const void **) &rhost);


Can somebody please suggest, how to get port. I know sshd has this information as i cna see in the sshd logs, but how do i retrieve it in PAM module .


sshd logs has port no, 50469 

Oct  9 07:20:43 x86-hw auth.info sshd[13128]: Accepted none for secadmin from 10.220.82.17 port 50469 ssh2




Regards,
Ivan. 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]