Connecting to a ssh endpoint with no auth (user only)

285 views
Skip to first unread message

Christopher Wray

unread,
Oct 15, 2018, 8:27:36 PM10/15/18
to sshj-users
I'm hoping to use sshj instead of Apache mina in an application which connects to a number of remote devices via ssh.

This device actually conforms to the TL1 specification so from a terminal I can login with no password
ssh -p 20000 -o HostKeyAlgorithms=ssh-dss root@<ip>

then in the interactive shell actually perform a login to the device using TL1 commands.


Is there a way that I can establish the ssh connection to the device using sshj and open a shell without authentication... I've tried using authPassword("root","") but I consistently get a UserAuthException

The code looks like this:

System.setProperty("org.slf4j.simpleLogger.showDateTime", "true");

((Logger)LoggerFactory.getLogger("com.ciena")).setLevel(Level.DEBUG);

final SSHClient ssh = new SSHClient();

ssh.loadKnownHosts(new File("~/.ssh/known_hosts"));

ssh.addHostKeyVerifier(new PromiscuousVerifier());

ssh.addAlgorithmsVerifier(new AlgorithmsVerifier() {

   @Override

   public boolean verify(NegotiatedAlgorithms algorithms) {

       System.out.println("Negotiated " + algorithms);

       return true;

    }

   });

       

ssh.connect("somehost", 20000);

       

Session session = null;

try {

       

   ssh.authPassword("root", "");

   //ssh.authPublickey("root");

   session = ssh.startSession();

   Shell shell = session.startShell();


}


Here is the debug log for the output


20:17:34.746 [main] DEBUG net.schmizz.sshj.DefaultConfig - Available cipher factories: [aes128-cbc, aes128-ctr, blowfish-cbc, cast128-cbc, cast128-ctr, idea-cbc, idea-ctr, serpent128-cbc, serpent128-ctr, 3des-cbc, 3des-ctr, twofish128-cbc, twofish128-ctr, arcfour, arcfour128]

20:17:34.849 [main] INFO  n.s.sshj.transport.TransportImpl - Client identity string: SSH-2.0-SSHJ_0.26.1_SNAPSHOT

20:17:34.891 [main] INFO  n.s.sshj.transport.TransportImpl - Server identity string: SSH-2.0-Ciena SSH 5.4

20:17:34.891 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<kex done>> to `null`

20:17:34.891 [main] DEBUG n.s.sshj.transport.KeyExchanger - Sending SSH_MSG_KEXINIT

20:17:34.901 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<kexinit sent>> to `SOME`

20:17:34.902 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<kex done>>

20:17:34.948 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Received SSH_MSG_KEXINIT

20:17:34.949 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Negotiated algorithms: [ kex=diffie-hellman-group1-sha1; sig=ssh-dss; c2sCipher=aes128-cbc; s2cCipher=aes128-cbc; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]

20:17:34.949 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Trying to verify algorithms with com.ciena.bp.jraskd.tl1.connection.impl.SSHConnection$1@2b081aa7

Negotiated [ kex=diffie-hellman-group1-sha1; sig=ssh-dss; c2sCipher=aes128-cbc; s2cCipher=aes128-cbc; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]

20:17:34.976 [reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Sending SSH_MSG_KEXDH_INIT

20:17:35.123 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Received kex followup data

20:17:35.123 [reader] DEBUG c.hierynomus.sshj.transport.kex.DHG - Received SSH_MSG_KEXDH_REPLY

20:17:35.152 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Trying to verify host key with net.schmizz.sshj.transport.verification.OpenSSHKnownHosts@69315577

20:17:35.152 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Trying to verify host key with net.schmizz.sshj.transport.verification.PromiscuousVerifier@17def259

20:17:35.153 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Sending SSH_MSG_NEWKEYS

20:17:35.168 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Received SSH_MSG_NEWKEYS

20:17:35.174 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<kexinit sent>> to `null`

20:17:35.174 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<kex done>> to `SOME`

20:17:35.174 [main] DEBUG net.schmizz.sshj.SSHClient - Key exchange took 0.283 seconds

20:17:38.325 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<service accept>> to `null`

20:17:38.325 [main] DEBUG n.s.sshj.transport.TransportImpl - Sending SSH_MSG_SERVICE_REQUEST for ssh-userauth

20:17:38.325 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<service accept>>

20:17:38.372 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<service accept>> to `SOME`

20:17:38.373 [main] DEBUG n.s.sshj.transport.TransportImpl - Setting active service to ssh-userauth

20:17:38.375 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<authenticated>> to `null`

20:17:38.375 [main] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - Trying `password` auth...

20:17:38.375 [main] DEBUG n.s.s.userauth.method.AuthPassword - Requesting password for [AccountResource] root@somehost

20:17:38.376 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<authenticated>>

20:17:47.818 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<authenticated>> to `false`

20:17:47.818 [main] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - `password` auth failed

20:17:47.818 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<authenticated>> to `null`

20:17:47.818 [main] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - Trying `keyboard-interactive` auth...

20:17:47.819 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<authenticated>>

20:17:52.824 [reader] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - Asking `keyboard-interactive` method to handle USERAUTH_60 packet

20:17:52.824 [reader] DEBUG n.s.s.u.m.PasswordResponseProvider - Challenge - name=`Challenge: `; instruction=`YfEKKAtL6tdEwzrL`

20:17:52.825 [reader] DEBUG n.s.s.u.m.AuthKeyboardInteractive - Requesting response for challenge `Response: `; echo=false

20:17:56.448 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <<authenticated>> to `false`

20:17:56.448 [main] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - `keyboard-interactive` auth failed

net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods

20:17:56.451 [main] INFO  n.s.sshj.transport.TransportImpl - Disconnected - BY_APPLICATION

20:17:56.451 [main] DEBUG n.schmizz.sshj.userauth.UserAuthImpl - Notified of net.schmizz.sshj.transport.TransportException: [BY_APPLICATION] Disconnected

20:17:56.451 [main] DEBUG n.s.sshj.transport.TransportImpl - Sending SSH_MSG_DISCONNECT: reason=[BY_APPLICATION], msg=[]

at net.schmizz.sshj.SSHClient.auth(SSHClient.java:231)

at net.schmizz.sshj.SSHClient.auth(SSHClient.java:206)

at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:292)

at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:262)

at net.schmizz.sshj.SSHClient.authPassword(SSHClient.java:246)

at com.ciena.bp.jraskd.tl1.connection.impl.SSHConnection.main(SSHConnection.java:45)

20:17:56.452 [main] DEBUG net.schmizz.concurrent.Promise - Setting <<transport close>> to `SOME`

20:17:56.452 [reader] DEBUG net.schmizz.sshj.transport.Reader - Stopping

Jeroen van Erp

unread,
Oct 16, 2018, 3:41:29 AM10/16/18
to sshj-...@googlegroups.com
Hi Christopher,

Can you post a debug/verbose session of the command line attempt? I'm wondering what the auth mechanism is that they're using?

Regards,
Jeroen

Op di 16 okt. 2018 om 02:27 schreef Christopher Wray <chris...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "sshj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sshj-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Wray

unread,
Oct 16, 2018, 9:24:39 AM10/16/18
to sshj-users
09:21:08.598 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Acceptor - setOption(SO_REUSEADDR)[true] from property=socket-reuseaddr
09:21:08.601 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Creating IoSession on /0:0:0:0:0:0:0:1:20000 from /0:0:0:0:0:0:0:1:52879
09:21:08.611 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.session.helpers.SessionTimeoutListener - sessionCreated(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) tracking
09:21:08.612 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - sendIdentification(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]): SSH-2.0-SSHD-CORE-1.6.0
09:21:08.613 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 25 bytes
09:21:08.614 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=25
09:21:08.615 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 21 bytes
09:21:08.615 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - doReadIdentification(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) line='SSH-2.0-OpenSSH_7.6'
09:21:08.615 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - readIdentification(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) client version string: SSH-2.0-OpenSSH_7.6
09:21:08.641 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider - resolveKeyPair(/keys/host.ser) loaded key=ssh-rsa-SHA256:knYJoQi/1475gWzl6Qo4o5umwlLXZqqKkjLFaIyqV8Q
09:21:08.643 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - sendKexInit(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Send SSH_MSG_KEXINIT
09:21:08.643 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 680 bytes
09:21:08.643 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=680
09:21:08.644 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 1360 bytes
09:21:08.644 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - handleKexInit(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_KEXINIT
09:21:08.645 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - setNegotiationResult(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Kex: server->client aes128-ctr hmac-sha2-256 none
09:21:08.645 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - setNegotiationResult(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Kex: client->server aes128-ctr hmac-sha2-256 none
09:21:08.652 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 80 bytes
09:21:08.655 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.kex.DHGServer - next(DHGServer[ecdh-sha2-nistp256])[ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]] process command=SSH_MSG_KEXDH_INIT
09:21:08.673 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.kex.DHGServer - next(DHGServer[ecdh-sha2-nistp256])[ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]] Send SSH_MSG_KEXDH_REPLY
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 392 bytes
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=392
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - handleKexMessage(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879])[ecdh-sha2-nistp256] KEX processing complete after cmd=30
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - sendNewKeys(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Send SSH_MSG_NEWKEYS
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 16 bytes
09:21:08.674 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=16
09:21:08.677 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 16 bytes
09:21:08.680 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - handleNewKeys(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_NEWKEYS command=SSH_MSG_NEWKEYS
09:21:08.680 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - receiveNewKeys(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) session ID=42:d4:aa:25:f8:96:3e:ec:f8:1d:0b:ae:3f:d8:a0:9d:3a:7f:f4:96:01:b4:db:22:e6:93:ce:6e:a3:82:fc:92
09:21:08.703 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - receiveNewKeys(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) inCipher=BaseCipher[AES,16,16,AES/CTR/NoPadding], outCipher=BaseCipher[AES,16,16,AES/CTR/NoPadding], recommended blocks limit=4294967296, actual=-1
09:21:08.703 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 64 bytes
09:21:08.704 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - handleServiceRequest(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_SERVICE_REQUEST 'ssh-userauth'
09:21:08.705 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerUserAuthService - ServerUserAuthService(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) authorized authentication methods: none
09:21:08.705 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl - handleServiceRequest(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Accepted service ssh-userauth
09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 80 bytes
09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=80
09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 80 bytes
09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerUserAuthService - process(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Received SSH_MSG_USERAUTH_REQUEST user=root, service=ssh-connection, method=none
09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerUserAuthService - process(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Authenticating user 'root' with service 'ssh-connection' and method 'none' (attempt 0 / 20)
09:21:08.707 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.auth.UserAuthNone - doAuth(root@ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) init=true
09:21:08.708 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerUserAuthService - handleAuthenticationSuccess(root@ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_USERAUTH_REQUEST
09:21:08.708 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 64 bytes
09:21:08.708 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=64
09:21:08.710 [sshd-SshServer[49140ade]-nio2-thread-1] INFO org.apache.sshd.server.session.ServerUserAuthService - Session root@/0:0:0:0:0:0:0:1:52879 authenticated
09:21:08.710 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 80 bytes
09:21:08.711 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerConnectionService - channelOpen(ServerConnectionService[ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]]) SSH_MSG_CHANNEL_OPEN sender=0, type=session, window-size=1048576, packet-size=16384
09:21:08.722 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - init() service=ServerConnectionService[ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]] session=ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879] id=0
09:21:08.722 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.channel.Window - init(Window[server/local](ChannelSession[id=0, recipient=-1]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879])) size=2097152, max=2097152, packet=32768
09:21:08.723 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerConnectionService - registerChannel(ServerConnectionService[ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]])[id=0] ChannelSession[id=0, recipient=-1]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]
09:21:08.723 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - setRecipient(ChannelSession[id=0, recipient=-1]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) recipient=0
09:21:08.723 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.channel.Window - init(Window[server/remote](ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879])) size=1048576, max=1048576, packet=16384
09:21:08.723 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.channel.Window - init(Window[server/local](ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879])) re-initializing
09:21:08.723 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.channel.Window - init(Window[server/local](ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879])) size=2097152, max=2097152, packet=32768
09:21:08.725 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerConnectionService - operationComplete(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) send SSH_MSG_CHANNEL_OPEN_CONFIRMATION recipient=0, sender=0, window-size=2097152, packet-size=32768
09:21:08.725 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 80 bytes
09:21:08.726 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=80
09:21:08.726 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) read 496 bytes
09:21:08.726 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - handleChannelRequest(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_CHANNEL_REQUEST pty-req wantReply=true
09:21:08.727 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - handlePtyReq(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]): term=xterm-256color, size=(120 - 25), pixels=(0, 0), modes=[{VEOL2=255, ECHOE=1, ECHO=1, PARMRK=0, IUTF8=1, PENDIN=1, IGNPAR=0, PARENB=0, ECHOKE=1, PARODD=0, VSTATUS=20, IXON=1, VSUSP=26, OCRNL=0, ECHONL=0, CS7=1, CS8=1, VWERASE=23, VLNEXT=22, ISTRIP=0, TOSTOP=0, INPCK=0, IMAXBEL=1, VSTART=17, VINTR=3, ONLRET=0, VEOL=255, ECHOCTL=1, VDSUSP=25, ONOCR=0, TTY_OP_ISPEED=38400, ICANON=1, VERASE=127, OPOST=1, VEOF=4, VKILL=21, ONLCR=1, ICRNL=1, IXANY=1, IEXTEN=1, VSTOP=19, VDISCARD=15, INLCR=0, IXOFF=0, ISIG=1, NOFLSH=0, ECHOK=1, VREPRINT=18, TTY_OP_OSPEED=38400, VQUIT=28, IGNCR=0}]
09:21:08.727 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=pty-req result=ReplySuccess, want-reply=true
09:21:08.727 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 64 bytes
09:21:08.727 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=64
09:21:08.727 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=pty-req no pending command
09:21:08.728 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - handleChannelRequest(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_CHANNEL_REQUEST env wantReply=false
09:21:08.728 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - handleEnv(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]): LANG = en_CA.UTF-8
09:21:08.728 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=env result=ReplySuccess, want-reply=false
09:21:08.728 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=env no pending command
09:21:08.729 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - handleChannelRequest(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) SSH_MSG_CHANNEL_REQUEST shell wantReply=true
09:21:08.732 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG com.grb.flirc2.tl1.TL1RecordingManager - Session 20000_1 command database:
 {"": {"ACT-USER::ADMIN1... 18:13:03 mult=1 left=1 linked=0": []}}
09:21:08.732 [sshd-SshServer[49140ade]-nio2-thread-1] INFO com.grb.flirc2.ssh.SSHServer - Session 1 on port 20000 created
09:21:08.735 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - prepareChannelCommand(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879])[shell] prepared command
09:21:08.735 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=shell result=ReplySuccess, want-reply=true
09:21:08.735 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - Writing 64 bytes
09:21:08.735 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.io.nio2.Nio2Session - handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:1:20000, remote=/0:0:0:0:0:0:0:1:52879]) finished writing len=64
09:21:08.735 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.channel.ChannelSession - sendResponse(ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]) request=shell activate command
09:21:08.736 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.common.channel.ChannelAsyncInputStream - Delaying read until data is available on ChannelAsyncInputStream[ChannelSession[id=0, recipient=0]-ServerSessionImpl[root@/0:0:0:0:0:0:0:1:52879]]


I'm guessing this is the difference - I need to authenticate with method 'none'. 


09:21:08.706 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.session.ServerUserAuthService - process(ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) Authenticating user 'root' with service 'ssh-connection' and method 'none' (attempt 0 / 20)
09:21:08.707 [sshd-SshServer[49140ade]-nio2-thread-1] DEBUG org.apache.sshd.server.auth.UserAuthNone - doAuth(root@ServerSessionImpl[null@/0:0:0:0:0:0:0:1:52879]) init=true

This is to a simulator, I cant get a debug log for a real network device.

Jeroen van Erp

unread,
Oct 16, 2018, 10:16:36 AM10/16/18
to sshj-...@googlegroups.com
Indeed, the auth mechanism is 'none'. Pass the AuthNone authenticator to the sshlient.auth(...) method.

Regards,
Jeroen

Op di 16 okt. 2018 om 15:24 schreef Christopher Wray <chris...@gmail.com>:

Christopher Wray

unread,
Oct 16, 2018, 10:27:15 AM10/16/18
to sshj-users

Got it


AuthMethod method = new AuthNone();

ssh.auth("root",method);


Thanks a lot Jeroen!



C

Reply all
Reply to author
Forward
0 new messages