Package org.apache.sshd.server

Examples of org.apache.sshd.server.TcpIpForwardFilter


        sshd.setPasswordAuthenticator(new PasswordAuthenticator() {
            public boolean authenticate(String username, String password, ServerSession session) {
                return username != null && username.equals(password);
            }
        });
        sshd.setTcpIpForwardFilter(new TcpIpForwardFilter() {
            public boolean canListen(InetSocketAddress address, ServerSession session) {
                return true;
            }

            public boolean canConnect(InetSocketAddress address, ServerSession session) {
View Full Code Here


        } catch (RuntimeException e) {
            address = null;
        }

        final ServerSession serverSession = (ServerSession)getSession();
        final TcpIpForwardFilter filter = serverSession.getServerFactoryManager().getTcpIpForwardFilter();
        if (address == null || filter == null || !filter.canConnect(address, serverSession)) {
            super.close(true);
            f.setException(new OpenChannelException(SshConstants.SSH_OPEN_ADMINISTRATIVELY_PROHIBITED, "connect denied"));
            return f;
        }
View Full Code Here

            addr = new InetSocketAddress(address, port);
        } catch (RuntimeException e) {
            addr = null;
        }

        final TcpIpForwardFilter filter = session.getServerFactoryManager().getTcpIpForwardFilter();
        if (addr == null || filter == null || !filter.canListen(addr, session)) {
            if (wantReply) {
                buffer = session.createBuffer(SshConstants.Message.SSH_MSG_REQUEST_FAILURE);
                session.writePacket(buffer);
            }
            return;
View Full Code Here

TOP

Related Classes of org.apache.sshd.server.TcpIpForwardFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.