Skip to content

Commit 1f7dc46

Browse files
authored
Use sshd container 1.1.0 (#5486)
1 parent 00faa95 commit 1f7dc46

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

core/src/main/java/org/testcontainers/containers/PortForwardingContainer.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ public enum PortForwardingContainer {
3131
private Connection createSSHSession() {
3232
String password = UUID.randomUUID().toString();
3333
container =
34-
new GenericContainer<>(DockerImageName.parse("testcontainers/sshd:1.0.0"))
34+
new GenericContainer<>(DockerImageName.parse("testcontainers/sshd:1.1.0"))
3535
.withExposedPorts(22)
3636
.withEnv("PASSWORD", password)
3737
.withCommand(
3838
"sh",
3939
"-c",
4040
// Disable ipv6 & Make it listen on all interfaces, not just localhost
41-
"echo \"root:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D -o PermitRootLogin=yes -o AddressFamily=inet -o GatewayPorts=yes"
41+
// Enable algorithms supported by our ssh client library
42+
"echo \"root:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D -o PermitRootLogin=yes " +
43+
"-o AddressFamily=inet -o GatewayPorts=yes -o AllowAgentForwarding=yes -o AllowTcpForwarding=yes " +
44+
"-o KexAlgorithms=+diffie-hellman-group1-sha1 -o HostkeyAlgorithms=+ssh-rsa "
4245
);
4346
container.start();
4447

docs/features/configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Some companies disallow the usage of Docker Hub, but you can override `*.image`
5252
> **tinyimage.container.image = alpine:3.14**
5353
> Used to check whether images can be pulled at startup, and always required (unless [startup checks are disabled](#disabling-the-startup-checks))
5454
55-
> **sshd.container.image = testcontainers/sshd:1.0.0**
55+
> **sshd.container.image = testcontainers/sshd:1.1.0**
5656
> Required if [exposing host ports to containers](./networking.md#exposing-host-ports-to-the-container)
5757
5858
> **vncrecorder.container.image = testcontainers/vnc-recorder:1.1.0**

0 commit comments

Comments
 (0)