TuanNN
TuanNN

Reputation: 105

Is it possible to get IP address of SSH/SFTP client via Apache Mina SSHD ServerSession?

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.

Upvotes: 1

Views: 931

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202310

Use ServerSession.getIoSession to retrieve an IoSession instance. And on that, call IoSession.getRemoteAddress():

serverSession.getIoSession().getRemoteAddress()

Upvotes: 1

Related Questions