|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.maverick.sshd.NoneAuthentication
public class NoneAuthentication
This authentication mechanism can be used to send custom banner messages to the client. When an SSH client connects it sends a 'none' authentication request with the username of the connecting user, normally the Maverick SSHD will send the default banner message configured in the ConfigurationContext.
However you can extend this class and override the getBannerForUser method to return a banner message for a specific user. To configure the SSHD to use your class instead of the default behaviour add it to the supported authentication mechanisms in your SshDaemon.configure method. Also make sure that no banner is configured in the SshContext.
context.supportedAuthenticationMechanisms().add("none", MyNoneAuthentication.class);
| Constructor Summary | |
|---|---|
NoneAuthentication()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getBannerForUser(java.lang.String username)
Override this method to send user customized banners, if this method is overridden then com.maverick.sshd.SshContext.setBannerMessage(null) should be set to null. |
java.lang.String |
getMethod()
Return the SSH method name for this authentication. |
void |
init(TransportProtocol transport,
AuthenticationProtocol authentication,
byte[] sessionid)
Initializes the mechanism with variables. |
boolean |
processMessage(byte[] msg)
If the SSH protocol authentication method defines additional messages which are sent from the client, they will be passed into your implementation here when received. |
boolean |
startRequest(java.lang.String username,
byte[] msg)
Start an authentication transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NoneAuthentication()
| Method Detail |
|---|
public final java.lang.String getMethod()
getMethod in interface AuthenticationMechanism
public final void init(TransportProtocol transport,
AuthenticationProtocol authentication,
byte[] sessionid)
throws java.io.IOException
init in interface AuthenticationMechanismtransport - the transport protocolauthentication - the authentication protocolsessionid - the id of the current session.
java.io.IOException
public final boolean processMessage(byte[] msg)
throws java.io.IOException
processMessage in interface AuthenticationMechanismmsg - byte[]
java.io.IOExceptionpublic java.lang.String getBannerForUser(java.lang.String username)
username -
public final boolean startRequest(java.lang.String username,
byte[] msg)
throws java.io.IOException
startRequest in interface AuthenticationMechanismusername - Stringmsg - the request data from the SSH_MSG_USERAUTH_REQUEST message
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||