login about faq

I am attempting to set up an SSH tunnel between the localhost and a remote server. I would like for a client to be able to connect to port 27002 on the localhost and have the connection tunneled to port 27002 on the remote host. There is an SSH server listening at port 2222 on the remote host. The remote host IP is 128.1.1.10. Below is the output of the debug messages, followed by the code I am using to set up the tunnel.

Created key from file: true
Set auth key: true
ChilkatLog:
  SetSshAuthenticationKey(1ms):
    DllDate: Mar  6 2015
    ChilkatVersion: 9.5.0.48
    UnlockPrefix: Anything for 30-day trial
    Architecture: Little Endian; 64-bit
    Language: MAC OS X Java
    VerboseLogging: 1
    Success.
  --SetSshAuthenticationKey
--ChilkatLog

Authenticated: true
Passed is: false
ChilkatLog:
  BeginAccepting(1033ms):
    DllDate: Mar  6 2015
    ChilkatVersion: 9.5.0.48
    UnlockPrefix: Anything for 30-day trial
    Architecture: Little Endian; 64-bit
    Language: MAC OS X Java
    VerboseLogging: 1
    listenPort: 27002
    destPort: 27002
    destHostname: 128.1.1.10
    Listen thread did not start.
    Failed.
  --BeginAccepting
--ChilkatLog

Done

    public void connect() throws Exception {
        NativeUtils.loadLibraryFromJar("/libchilkat.jnilib");
        CkSshTunnel ssh = new CkSshTunnel();
        ssh.put_VerboseLogging(true);
        ssh.put_KeepConnectLog(true);

//  Any string automatically begins a fully-functional 30-day trial.
        boolean success = ssh.UnlockComponent("Anything for 30-day trial");
        if (success != true) {
            System.out.println(ssh.lastErrorText());
            return;
        }

        ssh.put_DestHostname(remoteServerIp);
        ssh.put_DestPort(remotePort);

        ssh.put_SshHostname(remoteServerIp);
        ssh.put_SshPort(serverSshPort);
        ssh.put_SshLogin(serverUsername);

        ssh.put_DebugLogFilePath(debugFilePath);

        CkSshKey key = new CkSshKey();
        String keyString = key.loadText(certFile);

        boolean b = key.FromOpenSshPrivateKey(keyString);
        System.out.println("Created key from file: " + b);

        b = ssh.SetSshAuthenticationKey(key);
        System.out.println("Set auth key: " + b);

        System.out.println(ssh.lastErrorText());
        System.out.println("Authenticated: " + success);
        if (success != true) {
            System.out.println("Success is: " + ssh.lastErrorText());
            return;
        }

        boolean passed = ssh.BeginAccepting(localport);
        System.out.println("Passed is: " + passed);

        System.out.println(ssh.lastErrorText());

    }

asked Apr 03 '15 at 15:45

robbob's gravatar image

robbob
1


If you wish, I'll post a new build that may fix this problem..

link

answered Apr 06 '15 at 22:01

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×23
×21

Asked: Apr 03 '15 at 15:45

Seen: 847 times

Last updated: Apr 07 '15 at 11:11

powered by OSQA