Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection hopping: netcat processes are never killed #70

Open
tkambler opened this issue Mar 28, 2022 · 0 comments
Open

Connection hopping: netcat processes are never killed #70

tkambler opened this issue Mar 28, 2022 · 0 comments

Comments

@tkambler
Copy link

When I run the following example, I see that instances of nc (netcat) continue to run on the bastion server after the connection has been closed. If I run this example multiple times, then many instances of nc continue to run.

While this issue should be fixed, I do also see that I can avoid it entirely if I specify hoppingTool: 'native' as a config option. I was hoping you would explain why native is not the default option and what the tradeoffs are between these approaches. Thanks!

const target = {
    host: 'foo.com',
    username: 'user',
    identity: privateKeyPath,
  };

const bastion = {
  host: '127.0.0.1',
  username: 'test',
  password: 'test',
  port: 23,
};

const ssh = new SSH2Promise([bastion, target]);

await ssh.connect();

const data = await ssh.exec('whoami');
console.log(data.trim());

await ssh.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant