@Override
 public void setSession(final ServerSession session) {
   final SocketAddress remoteAddress = session.getIoSession().getRemoteAddress();
   String hostName = "";
   String port = "";
   if (remoteAddress instanceof InetSocketAddress) {
     hostName = ((InetSocketAddress) remoteAddress).getAddress().getHostAddress();
     port = Integer.toString(((InetSocketAddress) remoteAddress).getPort());
   }
   netconfHelloMessageAdditionalHeader =
       new NetconfHelloMessageAdditionalHeader(
           session.getUsername(), hostName, port, "ssh", "client");
 }
Example #2
0
 private boolean checkPassword(ServerSession session, String username, String password)
     throws Exception {
   PasswordAuthenticator auth = session.getServerFactoryManager().getPasswordAuthenticator();
   if (auth != null) {
     return auth.authenticate(username, password, session);
   }
   throw new Exception("No PasswordAuthenticator configured");
 }
Example #3
0
 public void setSession(final ServerSession session) {
   SshSession s = session.getAttribute(SshSession.KEY);
   this.context = sshScope.newContext(schemaFactory, s, "");
 }
 public void setSession(final ServerSession session) {
   final SshSession s = session.getAttribute(SshSession.KEY);
   this.ctx = sshScope.newContext(s, commandLine);
 }