From fce5672efd5c0a929d65f6bbba4a8228278d8e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 24 Apr 2024 12:31:35 +0200 Subject: [PATCH] chore: use new sshd:1.2.0 image (#1160) --- src/Testcontainers/Containers/PortForwarding.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Testcontainers/Containers/PortForwarding.cs b/src/Testcontainers/Containers/PortForwarding.cs index 0fa61a035..dcb768900 100644 --- a/src/Testcontainers/Containers/PortForwarding.cs +++ b/src/Testcontainers/Containers/PortForwarding.cs @@ -61,19 +61,10 @@ public Task ExposeHostPortsAsync(IEnumerable ports, CancellationToken ct [PublicAPI] private sealed class PortForwardingBuilder : ContainerBuilder { - public const string SshdImage = "testcontainers/sshd:1.1.0"; + public const string SshdImage = "testcontainers/sshd:1.2.0"; public const ushort SshdPort = 22; - private const string Command = "echo \"$USERNAME:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D" - + " -o AddressFamily=inet" - + " -o AllowAgentForwarding=yes" - + " -o AllowTcpForwarding=yes" - + " -o GatewayPorts=yes" - + " -o HostkeyAlgorithms=+ssh-rsa" - + " -o KexAlgorithms=+diffie-hellman-group1-sha1" - + " -o PermitRootLogin=yes"; - /// /// Initializes a new instance of the class. /// @@ -114,8 +105,6 @@ protected override PortForwardingBuilder Init() return base.Init() .WithImage(SshdImage) .WithPortBinding(SshdPort, true) - .WithEntrypoint("/bin/sh", "-c") - .WithCommand(Command) .WithUsername("root") .WithPassword("root") .WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(SshdPort));