Skip to content

InteractiveProcessShellFactory . Each character entered is repeated #469

@whyDK37

Description

@whyDK37

Version

2.12.1

Bug description

Start a service with sshd, connect to the service with iterm, and repeat each time you enter the command, including carriage return

Actual behavior

Using follow code to start one server .

        SshServer sshd = ServerBuilder.builder()
                .build();

        sshd.setShellFactory(InteractiveProcessShellFactory.INSTANCE);

        SimpleGeneratorHostKeyProvider keyPairProvider = new SimpleGeneratorHostKeyProvider(Paths.get("/tmp/key"));
        keyPairProvider.setOverwriteAllowed(false);
        sshd.setKeyPairProvider(keyPairProvider);

        sshd.setPasswordAuthenticator(AcceptAllPasswordAuthenticator.INSTANCE);
        sshd.setFileSystemFactory(new NativeFileSystemFactory());
        sshd.setCommandFactory(ProcessShellCommandFactory.INSTANCE);
        sshd.setPort(22);
        sshd.start();
        System.out.println("sshd.isStarted() = " + sshd.isStarted());
        TimeUnit.DAYS.sleep(1);
        sshd.stop();

Console log :

15:58:02.758 [main] INFO  org.apache.sshd.common.io.DefaultIoServiceFactoryFactory [getIoServiceProvider:68] - No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
sshd.isStarted() = true

Then use Iterm to connect to ssh server.
image

Expected behavior

Expect to use commands like a normal shell after connecting to the sshd service

Relevant log output

No response

Other information

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing a bug in the code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions