Skip to content

Commit

Permalink
Use sshd container 1.1.0 (#5486)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrinot committed Jun 22, 2022
1 parent 00faa95 commit 1f7dc46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -31,14 +31,17 @@ public enum PortForwardingContainer {
private Connection createSSHSession() {
String password = UUID.randomUUID().toString();
container =
new GenericContainer<>(DockerImageName.parse("testcontainers/sshd:1.0.0"))
new GenericContainer<>(DockerImageName.parse("testcontainers/sshd:1.1.0"))
.withExposedPorts(22)
.withEnv("PASSWORD", password)
.withCommand(
"sh",
"-c",
// Disable ipv6 & Make it listen on all interfaces, not just localhost
"echo \"root:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D -o PermitRootLogin=yes -o AddressFamily=inet -o GatewayPorts=yes"
// Enable algorithms supported by our ssh client library
"echo \"root:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D -o PermitRootLogin=yes " +
"-o AddressFamily=inet -o GatewayPorts=yes -o AllowAgentForwarding=yes -o AllowTcpForwarding=yes " +
"-o KexAlgorithms=+diffie-hellman-group1-sha1 -o HostkeyAlgorithms=+ssh-rsa "
);
container.start();

Expand Down
2 changes: 1 addition & 1 deletion docs/features/configuration.md
Expand Up @@ -52,7 +52,7 @@ Some companies disallow the usage of Docker Hub, but you can override `*.image`
> **tinyimage.container.image = alpine:3.14**
> Used to check whether images can be pulled at startup, and always required (unless [startup checks are disabled](#disabling-the-startup-checks))
> **sshd.container.image = testcontainers/sshd:1.0.0**
> **sshd.container.image = testcontainers/sshd:1.1.0**
> Required if [exposing host ports to containers](./networking.md#exposing-host-ports-to-the-container)
> **vncrecorder.container.image = testcontainers/vnc-recorder:1.1.0**
Expand Down

0 comments on commit 1f7dc46

Please sign in to comment.