You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Daniel Henrique Alves Lima <em...@yahoo.com.br> on 2011/06/02 02:40:02 UTC

Apache SSHD - IP filtering/selector?

    Hi.

    A newbie question:

    Is it possible to write an UserAuth that will refuse connections 
based on the client IP? Is it possible to prevent connection from a 
range of IPs in any other way? How?
    I have a dynamic range of IPs and I want to simply allow or deny 
connections coming from those IPs. How should I proceed?

    Thanks in advance.

         Best regards,

             Daniel.

Re: Apache SSHD - IP filtering/selector?

Posted by Guillaume Nodet <gn...@gmail.com>.
You should be able to obtain the IP using
serverSession.getIoSession().getRemoteAddress()

On Tue, Jun 7, 2011 at 01:39, Daniel Henrique Alves Lima
<em...@yahoo.com.br> wrote:
>
> David Latorre wrote:
>>
>> Hello Daniel ,
>>
>
> Hi, David.
>>
>> If you need your IP filterting to be based on the user logging in (As
>> opposed to the 'generic' filtering capabilities in MINA FTPServer you
>> mentioned)
>
> This will do the trick, but can I do it using SSHD?
>
>> I guess the best place to add this check is  the
>> 'authentication' process.
>>
>
> That was my first thought.
>
>> I'm not familiar with SSHD so I can't tell if you can get the remote
>> IP from the ServerSession, but I would implement my own
>> PasswordAuthenticatior to fulfill the ip check.
>>
>
> I faced the same issue: How can I retrieve the client IP from ServerSession?
>>
>> 2011/6/4 Daniel Henrique Alves Lima <em...@yahoo.com.br>:
>>
>>>
>>>  I intent to use this feature to allow anonymous authentication only for
>>> connections coming from the same host:
>>>
>>> http://techdm.com/grails/?p=323&lang=en
>>>
>>>  Is override SshServer.createAcceptor() and return a specialized
>>> NioSocketAcceptor the way to go?
>>>
>>> http://www.mail-archive.com/users@mina.apache.org/msg03829.html
>>>
>>>  Thanks.
>>>
>>> Daniel Henrique Alves Lima wrote:
>>>
>>>>
>>>>  I'm probably looking for a SSHD implementation of the following
>>>> feature:
>>>>
>>>>
>>>>
>>>> https://issues.apache.org/jira/browse/FTPSERVER-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998022#comment-12998022
>>>>
>>>>
>>>> Daniel Henrique Alves Lima wrote:
>>>>
>>>>>
>>>>>  Hi.
>>>>>
>>>>>  A newbie question:
>>>>>
>>>>>  Is it possible to write an UserAuth that will refuse connections based
>>>>> on the client IP? Is it possible to prevent connection from a range of
>>>>> IPs
>>>>> in any other way? How?
>>>>>  I have a dynamic range of IPs and I want to simply allow or deny
>>>>> connections coming from those IPs. How should I proceed?
>>>>>
>>>>>  Thanks in advance.
>>>>>
>>>>>       Best regards,
>>>>>
>>>>>           Daniel.
>>>>>
>>>>>
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Apache SSHD - IP filtering/selector?

Posted by Daniel Henrique Alves Lima <em...@yahoo.com.br>.
David Latorre wrote:
> Hello Daniel ,
>   

Hi, David.
>
> If you need your IP filterting to be based on the user logging in (As
> opposed to the 'generic' filtering capabilities in MINA FTPServer you
> mentioned) 
This will do the trick, but can I do it using SSHD?

> I guess the best place to add this check is  the
> 'authentication' process.
>   
That was my first thought.

> I'm not familiar with SSHD so I can't tell if you can get the remote
> IP from the ServerSession, but I would implement my own
> PasswordAuthenticatior to fulfill the ip check.
>   

I faced the same issue: How can I retrieve the client IP from ServerSession?
>
> 2011/6/4 Daniel Henrique Alves Lima <em...@yahoo.com.br>:
>   
>>   I intent to use this feature to allow anonymous authentication only for
>> connections coming from the same host:
>>
>> http://techdm.com/grails/?p=323&lang=en
>>
>>   Is override SshServer.createAcceptor() and return a specialized
>> NioSocketAcceptor the way to go?
>>
>> http://www.mail-archive.com/users@mina.apache.org/msg03829.html
>>
>>   Thanks.
>>
>> Daniel Henrique Alves Lima wrote:
>>     
>>>   I'm probably looking for a SSHD implementation of the following feature:
>>>
>>>
>>> https://issues.apache.org/jira/browse/FTPSERVER-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998022#comment-12998022
>>>
>>>
>>> Daniel Henrique Alves Lima wrote:
>>>       
>>>>   Hi.
>>>>
>>>>   A newbie question:
>>>>
>>>>   Is it possible to write an UserAuth that will refuse connections based
>>>> on the client IP? Is it possible to prevent connection from a range of IPs
>>>> in any other way? How?
>>>>   I have a dynamic range of IPs and I want to simply allow or deny
>>>> connections coming from those IPs. How should I proceed?
>>>>
>>>>   Thanks in advance.
>>>>
>>>>        Best regards,
>>>>
>>>>            Daniel.
>>>>
>>>>         

Re: Apache SSHD - IP filtering/selector?

Posted by David Latorre <dv...@gmail.com>.
Hello Daniel ,


If you need your IP filterting to be based on the user logging in (As
opposed to the 'generic' filtering capabilities in MINA FTPServer you
mentioned) I guess the best place to add this check is  the
'authentication' process.

I'm not familiar with SSHD so I can't tell if you can get the remote
IP from the ServerSession, but I would implement my own
PasswordAuthenticatior to fulfill the ip check.


2011/6/4 Daniel Henrique Alves Lima <em...@yahoo.com.br>:
>   I intent to use this feature to allow anonymous authentication only for
> connections coming from the same host:
>
> http://techdm.com/grails/?p=323&lang=en
>
>   Is override SshServer.createAcceptor() and return a specialized
> NioSocketAcceptor the way to go?
>
> http://www.mail-archive.com/users@mina.apache.org/msg03829.html
>
>   Thanks.
>
> Daniel Henrique Alves Lima wrote:
>>
>>   I'm probably looking for a SSHD implementation of the following feature:
>>
>>
>> https://issues.apache.org/jira/browse/FTPSERVER-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998022#comment-12998022
>>
>>
>> Daniel Henrique Alves Lima wrote:
>>>
>>>   Hi.
>>>
>>>   A newbie question:
>>>
>>>   Is it possible to write an UserAuth that will refuse connections based
>>> on the client IP? Is it possible to prevent connection from a range of IPs
>>> in any other way? How?
>>>   I have a dynamic range of IPs and I want to simply allow or deny
>>> connections coming from those IPs. How should I proceed?
>>>
>>>   Thanks in advance.
>>>
>>>        Best regards,
>>>
>>>            Daniel.
>>>
>

Re: Apache SSHD - IP filtering/selector?

Posted by Daniel Henrique Alves Lima <em...@yahoo.com.br>.
    I intent to use this feature to allow anonymous authentication only 
for connections coming from the same host:

http://techdm.com/grails/?p=323&lang=en

    Is override SshServer.createAcceptor() and return a specialized 
NioSocketAcceptor the way to go?

http://www.mail-archive.com/users@mina.apache.org/msg03829.html

    Thanks.

Daniel Henrique Alves Lima wrote:
>    I'm probably looking for a SSHD implementation of the following 
> feature:
>
>    
> https://issues.apache.org/jira/browse/FTPSERVER-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998022#comment-12998022 
>
>
>
> Daniel Henrique Alves Lima wrote:
>>    Hi.
>>
>>    A newbie question:
>>
>>    Is it possible to write an UserAuth that will refuse connections 
>> based on the client IP? Is it possible to prevent connection from a 
>> range of IPs in any other way? How?
>>    I have a dynamic range of IPs and I want to simply allow or deny 
>> connections coming from those IPs. How should I proceed?
>>
>>    Thanks in advance.
>>
>>         Best regards,
>>
>>             Daniel.
>>

Re: Apache SSHD - IP filtering/selector?

Posted by Daniel Henrique Alves Lima <em...@yahoo.com.br>.
    I'm probably looking for a SSHD implementation of the following 
feature:

    
https://issues.apache.org/jira/browse/FTPSERVER-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998022#comment-12998022


Daniel Henrique Alves Lima wrote:
>    Hi.
>
>    A newbie question:
>
>    Is it possible to write an UserAuth that will refuse connections 
> based on the client IP? Is it possible to prevent connection from a 
> range of IPs in any other way? How?
>    I have a dynamic range of IPs and I want to simply allow or deny 
> connections coming from those IPs. How should I proceed?
>
>    Thanks in advance.
>
>         Best regards,
>
>             Daniel.
>