Skip to content

Commit fce5672

Browse files
authoredApr 24, 2024··
chore: use new sshd:1.2.0 image (#1160)
1 parent 136ca49 commit fce5672

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed
 

‎src/Testcontainers/Containers/PortForwarding.cs

+1-12
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,10 @@ public Task ExposeHostPortsAsync(IEnumerable<ushort> ports, CancellationToken ct
6161
[PublicAPI]
6262
private sealed class PortForwardingBuilder : ContainerBuilder<PortForwardingBuilder, PortForwardingContainer, PortForwardingConfiguration>
6363
{
64-
public const string SshdImage = "testcontainers/sshd:1.1.0";
64+
public const string SshdImage = "testcontainers/sshd:1.2.0";
6565

6666
public const ushort SshdPort = 22;
6767

68-
private const string Command = "echo \"$USERNAME:$PASSWORD\" | chpasswd && /usr/sbin/sshd -D"
69-
+ " -o AddressFamily=inet"
70-
+ " -o AllowAgentForwarding=yes"
71-
+ " -o AllowTcpForwarding=yes"
72-
+ " -o GatewayPorts=yes"
73-
+ " -o HostkeyAlgorithms=+ssh-rsa"
74-
+ " -o KexAlgorithms=+diffie-hellman-group1-sha1"
75-
+ " -o PermitRootLogin=yes";
76-
7768
/// <summary>
7869
/// Initializes a new instance of the <see cref="PortForwardingConfiguration" /> class.
7970
/// </summary>
@@ -114,8 +105,6 @@ protected override PortForwardingBuilder Init()
114105
return base.Init()
115106
.WithImage(SshdImage)
116107
.WithPortBinding(SshdPort, true)
117-
.WithEntrypoint("/bin/sh", "-c")
118-
.WithCommand(Command)
119108
.WithUsername("root")
120109
.WithPassword("root")
121110
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(SshdPort));

0 commit comments

Comments
 (0)
Please sign in to comment.