I create SFTP server using Apache Mina SSHD. I want to find out the client IP when they connect to my server (via FileZilla, WinSCP). However, while I tried to found it in ServerSession, I could not.
Where can I find this information?
Thank you.
Advertisement
Answer
Use ServerSession.getIoSession to retrieve an IoSession instance. And on that, call IoSession.getRemoteAddress():
serverSession.getIoSession().getRemoteAddress()