[英]Is it possible to get IP address of SSH/SFTP client via Apache Mina SSHD ServerSession?
I create SFTP server using Apache Mina SSHD.我使用 Apache Mina SSHD 创建 SFTP 服务器。 I want to find out the client IP when they connect to my server (via FileZilla, WinSCP).
我想在他们连接到我的服务器时找出客户端 IP(通过 FileZilla、WinSCP)。 However, while I tried to found it in
ServerSession
, I could not.然而,虽然我试图在
ServerSession
找到它,但我不能。
Where can I find this information?我在哪里可以找到这些信息?
Thank you.谢谢你。
Use ServerSession.getIoSession
to retrieve an IoSession
instance.使用
ServerSession.getIoSession
来检索IoSession
实例。 And on that, call IoSession.getRemoteAddress()
然后调用
IoSession.getRemoteAddress()
serverSession.getIoSession().getRemoteAddress()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.