Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 704af46

Browse files
author
junkern
committed
src: Bastion host jumping does not need netcat anymore.
1 parent a86e844 commit 704af46

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/Connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class SSHConnection {
125125
this.debug('Connecting to bastion host "%s"', bastionHost)
126126
const connectionToBastion = await this.connect(bastionHost)
127127
return new Promise<Client>((resolve, reject) => {
128-
connectionToBastion.exec(`nc ${this.options.endHost} ${this.options.endPort}`, async (err, stream) => {
128+
connectionToBastion.forwardOut('127.0.0.1', 22, this.options.endHost, this.options.endPort || 22, async (err, stream) => {
129129
if (err) {
130130
return reject(err)
131131
}

test/bastion-host/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:16.04
22

33
RUN apt-get update
4-
RUN apt-get install netcat -y
54
RUN apt-get -yq install openssh-server; \
65
mkdir -p /var/run/sshd; \
76
mkdir /root/.ssh && chmod 700 /root/.ssh; \

0 commit comments

Comments
 (0)