Retrieving tcp socket port in PAM module

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


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 sshd[13128]: Accepted none for secadmin from port 50469 ssh2

Pam-list mailing list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux