<div dir="ltr">Hi, <div>I am invoking my own login shell /bin/myshell once  PAM authentication is successfull. </div><div><br></div><div>My login shell, /bin/myshell requires remote ip (of client) , remote port (socket opened on node, where PAM module is sitting. </div><div><br></div><div>I could get remote host, from PAM_RHOST</div><div><br></div><div><div>retval = pam_get_item(pamh, PAM_RHOST, (const void **) &rhost);</div><div></div></div><div><br></div><div><br></div><div>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 .</div><div><br></div><div><br></div><div>sshd logs has port no, 50469 </div><div><br></div><div>Oct  9 07:20:43 x86-hw <a href="http://auth.info">auth.info</a> sshd[13128]: Accepted none for secadmin from 10.220.82.17 port 50469 ssh2<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>Regards,</div><div>Ivan. </div></div>