Hi Vishwanath:
following lines from "SshServer.java" (main method) seems to be working
for a default OS shell.
When I run the server on WinXP and it launches cmd.exe successfully and
I can run default commands.
-------------
if (OsUtils.isUNIX()) {
sshd.setShellFactory(new ProcessShellFactory(new String[] {
"/bin/sh", "-i", "-l" },
EnumSet.of(ProcessShellFactory.TtyOptions.ONlCr)));
} else {
sshd.setShellFactory(new ProcessShellFactory(new String[] {
"cmd.exe "},
EnumSet.of(ProcessShellFactory.TtyOptions.Echo,
ProcessShellFactory.TtyOptions.ICrNl,
ProcessShellFactory.TtyOptions.ONlCr)));
}
-------------
Thanks,
Nilesh.
On 2/1/2012 1:03 AM, Vishwanath Hawargi wrote:
Hi,
I am new to Apache SSHD, so apologies for the dumb questions.
I am using the standard set of calls to setup the server, port and the
factories before starting the server.
My requirement is to allow a user to login to a shell, type a command (not
scp commands, but my set of commands) (echoing what he types) and when he
hits enter,i would like the command to be executed and the output to be
dispalyed in the shell. I have the code to handle the commands, but I am
not able to get an interactive shell.
(Also, i am on Windows XP; passing "cmd" in shellFactory gives me a dumb
and deaf shell :) where nothing happens...)
please help, i am sure i am making some silly basic mistakes.
thank you.