I'm not sure what happens, but I think there's one thing that might cause the problem. This is the echo flag on the pty-req request. One thing that would help is turning on DEBUG logging (you might want to use another slf4j implementation such as the log4j one and configure log4j for debug logging). Can you also give us the output of the following command: stty -a I wonder if the lflag contains "echo" or "-echo".
On Sun, Sep 13, 2009 at 03:48, Matthieu Riou <[email protected]> wrote: > Hi, > > I'm trying to connect to the Mina SSHD server using the Linux OpenSSH > client (exact version 5.1p1-5ubuntu1). The handshake seems to be > working and I get to the shell but then the communication is one-way > only. What I type is sent to the server but the reply is lost > somewhere in between. I've tried both the process shell and the echo > shell, the symptoms are identical. Things seem to be working better > when I use the client shipped with SSHD but I'd really like to use the > "standard" client. > > I've pasted below the logs both on the server side and the client side > (with -v) using the echo shell (with a couple additional println), > hope that helps. Otherwise let me know if I should try something else. > > Thanks, > Matthieu > > =============== > Server Logs > > $ sudo java -cp > sshd-0.2.0/sshd-core/target/sshd-core-0.2.0.jar:mina-2.0.0-M6/dist/mina-core-2.0.0-M6.jar:mina-2.0.0-M6/lib/slf4j-api-1.5.2.jar:slf4j-1.5.2/slf4j-jdk14-1.5.2.jar:bcprov-jdk16-143.jar > org.apache.sshd.SshServer > Sep 12, 2009 6:35:08 PM > org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run > INFO: Trying to register BouncyCastle as a JCE provider > Sep 12, 2009 6:35:08 PM > org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration run > INFO: Registration succeeded > Sep 12, 2009 6:37:45 PM org.apache.sshd.server.session.ServerSession <init> > INFO: Session created... > Sep 12, 2009 6:37:45 PM > org.apache.sshd.common.keyprovider.FileKeyPairProvider loadKeys > INFO: Unable to read key /etc/ssh_host_dsa_key: > java.io.FileNotFoundException: /etc/ssh_host_dsa_key (No such file or > directory) > Sep 12, 2009 6:37:45 PM org.apache.sshd.server.session.ServerSession > readIdentification > INFO: Client version string: SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1 > Sep 12, 2009 6:37:45 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_KEXINIT > Sep 12, 2009 6:37:45 PM org.apache.sshd.server.kex.AbstractDHGServer next > INFO: Received SSH_MSG_KEXDH_INIT > Sep 12, 2009 6:37:46 PM > org.apache.sshd.common.keyprovider.FileKeyPairProvider loadKeys > INFO: Unable to read key /etc/ssh_host_dsa_key: > java.io.FileNotFoundException: /etc/ssh_host_dsa_key (No such file or > directory) > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.kex.AbstractDHGServer next > INFO: Send SSH_MSG_KEXDH_REPLY > Sep 12, 2009 6:37:46 PM org.apache.sshd.common.session.AbstractSession > sendNewKeys > INFO: Send SSH_MSG_NEWKEYS > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_NEWKEYS > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_SERVICE_REQUEST 'ssh-userauth' > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Accepting user authentication request > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authorized authentication methods: password,publickey > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_USERAUTH_REQUEST > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authenticating user 'foo' with method 'none' > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Unsupported authentication method 'none' > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_USERAUTH_REQUEST > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authenticating user 'foo' with method 'publickey' > Sep 12, 2009 6:37:46 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authentication failed: No PublickeyAuthenticator configured > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.session.ServerSession > handleMessage > INFO: Received SSH_MSG_USERAUTH_REQUEST > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authenticating user 'foo' with method 'password' > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.session.ServerSession userAuth > INFO: Authentication succeeded > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.session.ServerSession > channelOpen > INFO: Received SSH_MSG_CHANNEL_OPEN session > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received SSH_MSG_CHANNEL_REQUEST on channel 0 > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received channel request: pty-req > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received SSH_MSG_CHANNEL_REQUEST on channel 0 > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received channel request: env > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received SSH_MSG_CHANNEL_REQUEST on channel 0 > Sep 12, 2009 6:37:48 PM org.apache.sshd.server.channel.ChannelSession > handleRequest > INFO: Received channel request: shell > RECEIVED bar > WRITE > RECEIVED exit > WRITE > Sep 12, 2009 6:39:08 PM org.apache.sshd.common.channel.AbstractChannel sendEof > INFO: Send SSH_MSG_CHANNEL_EOF on channel 0 > Sep 12, 2009 6:39:08 PM > org.apache.sshd.server.channel.AbstractServerChannel sendExitStatus > INFO: Send SSH_MSG_CHANNEL_REQUEST exit-status on channel 0 > Sep 12, 2009 6:39:08 PM org.apache.sshd.common.channel.AbstractChannel close > INFO: Send SSH_MSG_CHANNEL_CLOSE on channel 0 > Sep 12, 2009 6:39:08 PM org.apache.sshd.common.channel.AbstractChannel > handleClose > INFO: Received SSH_MSG_CHANNEL_CLOSE on channel 0 > Sep 12, 2009 6:39:08 PM org.apache.sshd.common.session.AbstractSession close > INFO: Closing session > > ============== > Client logs > > $ ssh -v -p 8000 f...@localhost > OpenSSH_5.1p1 Debian-5ubuntu1, OpenSSL 0.9.8g 19 Oct 2007 > debug1: Reading configuration data /etc/ssh/ssh_config > debug1: Applying options for * > debug1: Connecting to localhost [::1] port 8000. > debug1: Connection established. > debug1: identity file /home/mriou/.ssh/identity type -1 > debug1: identity file /home/mriou/.ssh/id_rsa type 1 > debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048 > debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048 > debug1: identity file /home/mriou/.ssh/id_dsa type -1 > debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.2.0 > debug1: no match: SSHD-CORE-0.2.0 > debug1: Enabling compatibility mode for protocol 2.0 > debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1 > debug1: SSH2_MSG_KEXINIT sent > debug1: SSH2_MSG_KEXINIT received > debug1: kex: server->client aes128-cbc hmac-md5 none > debug1: kex: client->server aes128-cbc hmac-md5 none > debug1: sending SSH2_MSG_KEXDH_INIT > debug1: expecting SSH2_MSG_KEXDH_REPLY > debug1: Host '[localhost]:8000' is known and matches the RSA host key. > debug1: Found key in /home/mriou/.ssh/known_hosts:9 > debug1: ssh_rsa_verify: signature correct > debug1: SSH2_MSG_NEWKEYS sent > debug1: expecting SSH2_MSG_NEWKEYS > debug1: SSH2_MSG_NEWKEYS received > debug1: SSH2_MSG_SERVICE_REQUEST sent > debug1: SSH2_MSG_SERVICE_ACCEPT received > debug1: Authentications that can continue: password,publickey > debug1: Next authentication method: publickey > debug1: Trying private key: /home/mriou/.ssh/identity > debug1: Offering public key: /home/mriou/.ssh/id_rsa > debug1: Authentications that can continue: password,publickey > debug1: Trying private key: /home/mriou/.ssh/id_dsa > debug1: Next authentication method: password > f...@localhost's password: > debug1: Authentication succeeded (password). > debug1: channel 0: new [client-session] > debug1: Entering interactive session. > debug1: Sending environment. > debug1: Sending env LANG = en_US.UTF-8 > bar > debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 > exit > debug1: channel 0: free: client-session, nchannels 1 > Connection to localhost closed. > Transferred: sent 2392, received 1688 bytes, in 79.8 seconds > Bytes per second: sent 30.0, received 21.1 > debug1: Exit status 0 > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
