Hello.
I tried SSHd. It builds nicely, everything great in general. I use
Mina 2.0.0-M5 for it. However, when I use a regular SSH in a Mac or
Unix terminal, my STDOUT/STDIN somewhere gone. Nothing happens after
I've got shell prompt.

Nothing special on server side, just:

sshd.setShellFactory(new ProcessShellFactory(new String[]{"/bin/bash",
"-i", "-l"}));

Here is a full log from server:
-----------------------------
421 [main] INFO org.apache.sshd.common.util.SecurityUtils - Trying to
register BouncyCastle as a JCE provider
1022 [main] INFO org.apache.sshd.common.util.SecurityUtils -
Registration succeeded
8571 [NioProcessor-1] INFO
org.apache.sshd.common.keyprovider.FileKeyPairProvider - Generating
host key...
9734 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Client version string:
SSH-2.0-OpenSSH_5.1
9735 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_KEXINIT
9822 [NioProcessor-1] INFO org.apache.sshd.server.kex.DHG14 - Received
SSH_MSG_KEXDH_INIT
9902 [NioProcessor-1] INFO org.apache.sshd.server.kex.DHG14 - Send
SSH_MSG_KEXDH_REPLY
9902 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Send SSH_MSG_NEWKEYS
11486 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_NEWKEYS
11509 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_SERVICE_REQUEST 'ssh-userauth'
11509 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Accepting user
authentication request
11510 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Authorized
authentication methods: password,publickey
11510 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_USERAUTH_REQUEST
11511 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Authenticating user
'bo' with method 'none'
11511 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Unsupported
authentication method 'none'
13209 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_USERAUTH_REQUEST
13209 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Authenticating user
'bo' with method 'password'
13210 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Authentication
succeeded
13211 [NioProcessor-1] INFO
org.apache.sshd.server.session.ServerSession - Received
SSH_MSG_CHANNEL_OPEN session
13219 [NioProcessor-1] INFO
org.apache.sshd.server.channel.ChannelSession - Received
SSH_MSG_CHANNEL_REQUEST on channel 0
13219 [NioProcessor-1] INFO
org.apache.sshd.server.channel.ChannelSession - Received channel
request: pty-req
13221 [NioProcessor-1] INFO
org.apache.sshd.server.channel.ChannelSession - Received
SSH_MSG_CHANNEL_REQUEST on channel 0
13221 [NioProcessor-1] INFO
org.apache.sshd.server.channel.ChannelSession - Received channel
request: shell
13226 [NioProcessor-1] INFO
org.apache.sshd.server.shell.ProcessShellFactory - Starting shell with
command: '[/bin/bash, -i, -l]' and env: {TERM=xterm-color,
TERM_PROGRAM_VERSION=240.2, SHLVL=1, TERM_PROGRAM=Apple_Terminal,
__CF_USER_TEXT_ENCODING=0x1F5:0:0,
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man,
PWD=/Users/bo/NetBeansProjects/rush, JAVA_ARCH=x86_64, LOGNAME=bo,
JAVA_MAIN_CLASS_13175=org.some.test.Main, _=/usr/bin/java,
SSH_AUTH_SOCK=/tmp/launch-ln5eFv/Listeners, OLDPWD=/Users/bo,
SHELL=/bin/bash, LC_CTYPE=UTF-8,
TMPDIR=/var/folders/Bu/Bug2BvbtGR41Tlz9+9fBLU+++TI/-Tmp-/,
SECURITYSESSIONID=b8df20,
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/bo/android-sdk-1.1-r1:/Applications/Jython25b3/,
COMMAND_MODE=unix2003, LC_ALL=en_US.UTF-8,
DISPLAY=/tmp/launch-Aq3E59/:0, USER=bo, HOME=/Users/bo,
Apple_PubSub_Socket_Render=/tmp/launch-x78zRx/Render,
LANG=en_US.UTF-8}
-----------------------------

And this is what I'm getting in a terminal:
-----------------------------
$ ssh -p 8022 localhost
The authenticity of host '[localhost]:8022 ([::1]:8022)' can't be established.
DSA key fingerprint is ff:68:69:97:72:20:75:45:37:ba:bb:48:0e:25:0a:bb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:8022' (DSA) to the list of known hosts.
b...@localhost's password:
bash: no job control in this shell
sphinx:rush bo$
-----------------------------

So I've got my shell, but when I type, nothing happens at all. I've
looked at source code and seems like channel forwards all the
input/output correctly...

Any ideas what I am missing? Thanks.

--
Kind regards, bm

Reply via email to